Class: Orbacle::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/orbacle/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#locationObject

Returns the value of attribute location.



13
14
15
# File 'lib/orbacle/node.rb', line 13

def location
  @location
end

#paramsObject (readonly)

Returns the value of attribute params.



12
13
14
# File 'lib/orbacle/node.rb', line 12

def params
  @params
end

#typeObject (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_sObject



19
20
21
# File 'lib/orbacle/node.rb', line 19

def to_s
  "#<#{self.class.name}:#{self.object_id} @type=#{@type.inspect}>"
end