Class: Orbacle::Node
- Inherits:
-
Object
- Object
- Orbacle::Node
- Defined in:
- lib/orbacle/node.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, params, location = nil) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(type, params, location = nil) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 10 |
# File 'lib/orbacle/node.rb', line 5 def initialize(type, params, location = nil) @type = type raise if !params.is_a?(Hash) @params = params @location = location end |
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
13 14 15 |
# File 'lib/orbacle/node.rb', line 13 def location @location end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
12 13 14 |
# File 'lib/orbacle/node.rb', line 12 def params @params end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/orbacle/node.rb', line 12 def type @type end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/orbacle/node.rb', line 15 def ==(other) @type == other.type && @params == other.params end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/orbacle/node.rb', line 19 def to_s "#<#{self.class.name}:#{self.object_id} @type=#{@type.inspect}>" end |