Module: Base4R::ChildAttributeMethods::ClassMethods
- Defined in:
- lib/attribute.rb
Instance Method Summary collapse
- #child_attribute(attr, options = {}) ⇒ Object
- #default_child_options ⇒ Object
- #default_children_names ⇒ Object
Instance Method Details
#child_attribute(attr, options = {}) ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/attribute.rb', line 69 def child_attribute(attr, ={}) [attr.to_sym] = class_eval " def child_\#{attr}; children[:\#{attr}]; end\n def child_\#{attr}=(v); add_child(:\#{attr}, v); end\n def \#{attr}_value; \#{attr}.value; end\n def \#{attr}_value=(v); \#{attr}.value = v; end\n EOS\nend\n" |
#default_child_options ⇒ Object
79 |
# File 'lib/attribute.rb', line 79 def ; ||={}; end |
#default_children_names ⇒ Object
78 |
# File 'lib/attribute.rb', line 78 def default_children_names; .keys; end |