Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move Module / Class inclusion into lib/rbx/alpha.fy

  • Loading branch information...
commit b5b9a7ba7752d902f593329b7f84ef06ba7b5fe1 1 parent 969d668
@bakkdoor authored
Showing with 23 additions and 14 deletions.
  1. +0 −14 boot/fancy_ext/module.rb
  2. +23 −0 lib/rbx/alpha.fy
View
14 boot/fancy_ext/module.rb
@@ -1,18 +1,4 @@
class Module
- define_method :"included:" do |mod|
- nil # do nothing by default
- end
-
- # Fancy version does not restricts to only modules.
- define_method :"include:" do |modules|
- modules = [modules] unless modules.kind_of?(Array)
- modules.reverse_each do |mod|
- mod.send :"append_features:", self
- mod.send :included, self
- mod.send :"included:", self
- end
- end
-
# Fancy version does not restricts to only modules.
###
#
View
23 lib/rbx/alpha.fy
@@ -35,4 +35,27 @@ class Class {
class String {
alias_method: ":+" for: "+"
alias_method: ":to_sym" for: "to_sym"
+}
+
+class Module {
+ def included: module
+
+ def include: modules {
+ modules = modules to_a()
+ modules reverse_each() |mod| {
+ mod append_features: self
+ mod send('included, self)
+ }
+ }
+}
+
+class Class{
+ def include: modules {
+ modules = modules to_a()
+ modules reverse_each() |mod| {
+ mod append_features: self
+ mod send('included, self)
+ mod included: self
+ }
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.