Class: SFRP::Poly::DSL::CaseProxy
- Inherits:
-
Object
- Object
- SFRP::Poly::DSL::CaseProxy
- Defined in:
- lib/sfrp/poly/dsl.rb
Instance Method Summary collapse
- #case(pattern, &exp_block) ⇒ Object
-
#initialize ⇒ CaseProxy
constructor
A new instance of CaseProxy.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ CaseProxy
Returns a new instance of CaseProxy.
157 158 159 |
# File 'lib/sfrp/poly/dsl.rb', line 157 def initialize @cases = [] end |
Instance Method Details
#case(pattern, &exp_block) ⇒ Object
161 162 163 |
# File 'lib/sfrp/poly/dsl.rb', line 161 def case(pattern, &exp_block) @cases << MatchExp::Case.new(pattern, exp_block.call) end |
#to_a ⇒ Object
165 166 167 |
# File 'lib/sfrp/poly/dsl.rb', line 165 def to_a @cases end |