Class: ABNF::Compiler::Controls::Grammar::Example
- Inherits:
-
Object
- Object
- ABNF::Compiler::Controls::Grammar::Example
- Defined in:
- lib/abnf/compiler/controls/grammar.rb
Instance Attribute Summary collapse
-
#abnf ⇒ Object
readonly
Returns the value of attribute abnf.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(abnf, type) ⇒ Example
constructor
A new instance of Example.
- #rule ⇒ Object
Constructor Details
#initialize(abnf, type) ⇒ Example
Returns a new instance of Example.
9 10 11 12 |
# File 'lib/abnf/compiler/controls/grammar.rb', line 9 def initialize abnf, type @abnf = abnf @type = type end |
Instance Attribute Details
#abnf ⇒ Object (readonly)
Returns the value of attribute abnf.
6 7 8 |
# File 'lib/abnf/compiler/controls/grammar.rb', line 6 def abnf @abnf end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/abnf/compiler/controls/grammar.rb', line 7 def type @type end |
Instance Method Details
#rule ⇒ Object
14 15 16 |
# File 'lib/abnf/compiler/controls/grammar.rb', line 14 def rule @rule ||= type.compile abnf end |