Class: EacRubyUtils::ModuleAncestorsVariable::Base
- Defined in:
- lib/eac_ruby_utils/module_ancestors_variable/base.rb
Instance Method Summary collapse
-
#ancestors_variable ⇒ Object
return [Hash].
- #merge_operation(current, other) ⇒ Object
- #self_variable ⇒ Hash
Instance Method Details
#ancestors_variable ⇒ Object
return [Hash]
18 19 20 21 22 23 24 25 26 |
# File 'lib/eac_ruby_utils/module_ancestors_variable/base.rb', line 18 def ancestors_variable the_module.ancestors.inject(initial_value.dup) do |a, e| if e.respond_to?(method_name, true) merge_operation(a, e.send(method_name).send(:self_variable)) else a end end end |
#merge_operation(current, other) ⇒ Object
13 14 15 |
# File 'lib/eac_ruby_utils/module_ancestors_variable/base.rb', line 13 def merge_operation(current, other) current.merge(other) end |
#self_variable ⇒ Hash
29 30 31 |
# File 'lib/eac_ruby_utils/module_ancestors_variable/base.rb', line 29 def self_variable @self_variable ||= initial_value.dup end |