Class: Generated::IncludeRule
- Defined in:
- lib/ruby_grammar_builder/generated/rule.rb
Overview
Represents a rule in the form of { include = ‘#rule_name’; }
Instance Attribute Summary collapse
-
#rule ⇒ String
The included Rule name.
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(location, rule) ⇒ IncludeRule
constructor
A new instance of IncludeRule.
- #to_h ⇒ Object
Constructor Details
#initialize(location, rule) ⇒ IncludeRule
Returns a new instance of IncludeRule.
20 21 22 23 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 20 def initialize(location, rule) super(location) @rule = rule end |
Instance Attribute Details
#rule ⇒ String
Returns The included Rule name.
18 19 20 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 18 def rule @rule end |
Instance Method Details
#to_h ⇒ Object
25 26 27 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 25 def to_h {"include" => @rule} end |