Class: ASTUtils::NodeSet::Item
- Inherits:
-
Object
- Object
- ASTUtils::NodeSet::Item
- Defined in:
- lib/ast_utils/node_set.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(object) ⇒ Item
constructor
A new instance of Item.
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
#object ⇒ Object (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
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 |
#hash ⇒ Object
10 11 12 |
# File 'lib/ast_utils/node_set.rb', line 10 def hash object.__id__ end |