Class: GemfileParser::Node
- Inherits:
-
Object
- Object
- GemfileParser::Node
- Defined in:
- lib/gemfile_parser/node.rb
Instance Attribute Summary collapse
-
#root_node ⇒ Object
readonly
Returns the value of attribute root_node.
Instance Method Summary collapse
-
#initialize(root_node:) ⇒ Node
constructor
A new instance of Node.
- #match?(node) ⇒ Boolean
Constructor Details
#initialize(root_node:) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 |
# File 'lib/gemfile_parser/node.rb', line 5 def initialize( root_node: ) @root_node = root_node end |
Instance Attribute Details
#root_node ⇒ Object (readonly)
Returns the value of attribute root_node.
15 16 17 |
# File 'lib/gemfile_parser/node.rb', line 15 def root_node @root_node end |
Instance Method Details
#match?(node) ⇒ Boolean
11 12 13 |
# File 'lib/gemfile_parser/node.rb', line 11 def match?(node) exist?(@root_node, node) end |