Class: ABNF::Compiler::Controls::Grammar::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/abnf/compiler/controls/grammar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#abnfObject (readonly)

Returns the value of attribute abnf.



6
7
8
# File 'lib/abnf/compiler/controls/grammar.rb', line 6

def abnf
  @abnf
end

#typeObject (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

#ruleObject



14
15
16
# File 'lib/abnf/compiler/controls/grammar.rb', line 14

def rule
  @rule ||= type.compile abnf
end