Sha256: 76d27e4d9ec9347886fbdb5057352f2d10d85dac4bbb5b573bc539b126625d55
Contents?: true
Size: 792 Bytes
Versions: 5
Compression:
Stored size: 792 Bytes
Contents
require 'dentaku/exceptions' module Dentaku module AST class CaseConditional < Node attr_reader :when, :then def self.min_param_count 2 end def self.max_param_count 2 end def initialize(when_statement, then_statement) @when = when_statement unless @when.is_a?(AST::CaseWhen) raise ParseError.for(:node_invalid), 'Expected first argument to be a CaseWhen' end @then = then_statement unless @then.is_a?(AST::CaseThen) raise ParseError.for(:node_invalid), 'Expected second argument to be a CaseThen' end end def dependencies(context = {}) @when.dependencies(context) + @then.dependencies(context) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems