Class: Bcome::Node::Base
- Includes:
- CommandHelper
- Defined in:
- lib/nodes/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#meta_data ⇒ Object
readonly
Returns the value of attribute meta_data.
Instance Method Summary collapse
-
#initialize(meta_data) ⇒ Base
constructor
A new instance of Base.
- #machines ⇒ Object
- #method_missing(method_sym, *arguments, &block) ⇒ Object
- #set_parent_reference(parent, parent_reference_key, collection_key) ⇒ Object
Methods included from CommandHelper
Constructor Details
#initialize(meta_data) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/nodes/base.rb', line 12 def initialize() construct() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &block) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/nodes/base.rb', line 16 def method_missing(method_sym, *arguments, &block) if instance_variable_defined?("@#{method_sym}") return instance_variable_get("@#{method_sym}") else super end end |
Instance Attribute Details
#meta_data ⇒ Object (readonly)
Returns the value of attribute meta_data.
6 7 8 |
# File 'lib/nodes/base.rb', line 6 def @meta_data end |
Instance Method Details
#machines ⇒ Object
8 9 10 |
# File 'lib/nodes/base.rb', line 8 def machines raise "Should be overriden" end |
#set_parent_reference(parent, parent_reference_key, collection_key) ⇒ Object
24 25 26 27 28 |
# File 'lib/nodes/base.rb', line 24 def set_parent_reference(parent, parent_reference_key, collection_key) instance_variable_get("@#{collection_key}").map{|collection_item| collection_item.instance_variable_set("@#{parent_reference_key}", parent) } end |