Class: Antelope::DSL::Contexts::Production
- Defined in:
- lib/antelope/dsl/contexts/production.rb
Instance Attribute Summary collapse
-
#productions ⇒ Object
(also: #data)
readonly
private
Returns the value of attribute productions.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Antelope::DSL::Contexts::Base
Instance Attribute Details
#productions ⇒ Object (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_call ⇒ Object (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 |