fuel-plugin-sensu/deployment_scripts/puppet/files/embedded/lib/ruby/gems/2.3.0/gems/dentaku-2.0.9/lib/dentaku/ast/case/case_conditional.rb

24 lines
593 B
Ruby

module Dentaku
module AST
class CaseConditional < Node
attr_reader :when,
:then
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
def dependencies(context={})
@when.dependencies(context) + @then.dependencies(context)
end
end
end
end