Class: Generated::NameRule
- Defined in:
- lib/ruby_grammar_builder/generated/rule.rb
Overview
Represents a rule in the form of { name = ‘string’; }
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the rule.
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(location, name) ⇒ NameRule
constructor
A new instance of NameRule.
- #to_h ⇒ Object
Constructor Details
#initialize(location, name) ⇒ NameRule
Returns a new instance of NameRule.
37 38 39 40 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 37 def initialize(location, name) super(location) @name = name end |
Instance Attribute Details
#name ⇒ String
Returns The name of the rule.
35 36 37 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 35 def name @name end |
Instance Method Details
#to_h ⇒ Object
42 43 44 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 42 def to_h {"name" => @name} end |