Class: ASTUtils::NodeSet::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/ast_utils/node_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Item

Returns a new instance of Item.



6
7
8
# File 'lib/ast_utils/node_set.rb', line 6

def initialize(object)
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/ast_utils/node_set.rb', line 4

def object
  @object
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/ast_utils/node_set.rb', line 18

def ==(other)
  eql?(other)
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/ast_utils/node_set.rb', line 14

def eql?(other)
  other.is_a?(Item) && other.object.__id__ == object.__id__
end

#hashObject



10
11
12
# File 'lib/ast_utils/node_set.rb', line 10

def hash
  object.__id__
end