Class: Dentaku::AST::CaseConditional
- Defined in:
- lib/dentaku/ast/case/case_conditional.rb
Instance Attribute Summary collapse
-
#then ⇒ Object
readonly
Returns the value of attribute then.
-
#when ⇒ Object
readonly
Returns the value of attribute when.
Instance Method Summary collapse
- #dependencies(context = {}) ⇒ Object
-
#initialize(when_statement, then_statement) ⇒ CaseConditional
constructor
A new instance of CaseConditional.
Methods inherited from Node
Constructor Details
#initialize(when_statement, then_statement) ⇒ CaseConditional
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/dentaku/ast/case/case_conditional.rb', line 7 def initialize(when_statement, then_statement) @when = when_statement unless @when.is_a?(AST::CaseWhen) raise 'Expected first argument to be a CaseWhen' end @then = then_statement unless @then.is_a?(AST::CaseThen) raise 'Expected second argument to be a CaseThen' end end |
Instance Attribute Details
#then ⇒ Object (readonly)
Returns the value of attribute then.
4 5 6 |
# File 'lib/dentaku/ast/case/case_conditional.rb', line 4 def then @then end |
#when ⇒ Object (readonly)
Returns the value of attribute when.
4 5 6 |
# File 'lib/dentaku/ast/case/case_conditional.rb', line 4 def when @when end |
Instance Method Details
#dependencies(context = {}) ⇒ Object
18 19 20 |
# File 'lib/dentaku/ast/case/case_conditional.rb', line 18 def dependencies(context={}) @when.dependencies(context) + @then.dependencies(context) end |