Class: Generated::BeginEndRule
- Defined in:
- lib/ruby_grammar_builder/generated/rule.rb
Instance Attribute Summary collapse
-
#begin ⇒ String
The begin pattern.
-
#beginCaptures ⇒ Hash<String=>Rule>
The captures rules for begin.
-
#contentName ⇒ String?
The name for the contents matched.
-
#end ⇒ String
The end pattern.
-
#endCaptures ⇒ Hash<String=>Rule>
The captures rules for end.
-
#name ⇒ String?
The name for this rule.
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(location) ⇒ BeginEndRule
constructor
A new instance of BeginEndRule.
- #to_h ⇒ Object
Constructor Details
#initialize(location) ⇒ BeginEndRule
Returns a new instance of BeginEndRule.
99 100 101 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 99 def initialize(location) super(location) end |
Instance Attribute Details
#begin ⇒ String
Returns The begin pattern.
87 88 89 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 87 def begin @begin end |
#beginCaptures ⇒ Hash<String=>Rule>
Returns The captures rules for begin.
95 96 97 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 95 def beginCaptures @beginCaptures end |
#contentName ⇒ String?
Returns The name for the contents matched.
93 94 95 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 93 def contentName @contentName end |
#end ⇒ String
Returns The end pattern.
89 90 91 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 89 def end @end end |
#endCaptures ⇒ Hash<String=>Rule>
Returns The captures rules for end.
97 98 99 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 97 def endCaptures @endCaptures end |
#name ⇒ String?
Returns The name for this rule.
91 92 93 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 91 def name @name end |
Instance Method Details
#to_h ⇒ Object
103 104 105 106 107 108 109 110 111 112 |
# File 'lib/ruby_grammar_builder/generated/rule.rb', line 103 def to_h { "begin" => @begin, "end" => @end, "name" => @name, "contentName" => @contentName, "beginCaptures" => @beginCaptures.transform_values(&:to_h), "endCaptures" => @endCaptures.transform_values(&:to_h), }.compact end |