Fuel plugin to deploy Sensu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

case_conditional.rb 593B

1234567891011121314151617181920212223
  1. module Dentaku
  2. module AST
  3. class CaseConditional < Node
  4. attr_reader :when,
  5. :then
  6. def initialize(when_statement, then_statement)
  7. @when = when_statement
  8. unless @when.is_a?(AST::CaseWhen)
  9. raise 'Expected first argument to be a CaseWhen'
  10. end
  11. @then = then_statement
  12. unless @then.is_a?(AST::CaseThen)
  13. raise 'Expected second argument to be a CaseThen'
  14. end
  15. end
  16. def dependencies(context={})
  17. @when.dependencies(context) + @then.dependencies(context)
  18. end
  19. end
  20. end
  21. end