Class: Antelope::DSL::Contexts::Production

Inherits:
Base
  • Object
show all
Defined in:
lib/antelope/dsl/contexts/production.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#call, #context, #initialize

Constructor Details

This class inherits a constructor from Antelope::DSL::Contexts::Base

Instance Attribute Details

#productionsObject (readonly, private) Also known as: data

Returns the value of attribute productions.



11
12
13
# File 'lib/antelope/dsl/contexts/production.rb', line 11

def productions
  @productions
end

Instance Method Details

#before_callObject (private)



14
15
16
# File 'lib/antelope/dsl/contexts/production.rb', line 14

def before_call
  @productions = Hash.new { |h, k| h[k] = [] }
end

#production(name, &block) ⇒ Object



5
6
7
# File 'lib/antelope/dsl/contexts/production.rb', line 5

def production(name, &block)
  @productions[name].concat(context(Match, &block))
end