Class: GemfileParser::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nodeObject (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

Returns:

  • (Boolean)


11
12
13
# File 'lib/gemfile_parser/node.rb', line 11

def match?(node)
  exist?(@root_node, node)
end