Class: Simplabs::Excellent::Parsing::CaseContext

Inherits:
ConditionalContext show all
Defined in:
lib/simplabs/excellent/parsing/case_context.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from SexpContext

#file, #line, #name, #parent

Instance Method Summary collapse

Methods inherited from SexpContext

#full_name, #method_missing

Constructor Details

#initialize(exp, parent) ⇒ CaseContext

Returns a new instance of CaseContext.



11
12
13
14
15
# File 'lib/simplabs/excellent/parsing/case_context.rb', line 11

def initialize(exp, parent)
  super
  @has_else_clause = exp.last
  @tests_parameter = contains_parameter?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Simplabs::Excellent::Parsing::SexpContext

Instance Method Details

#has_else_clause?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/simplabs/excellent/parsing/case_context.rb', line 17

def has_else_clause?
  @has_else_clause
end

#tests_parameter?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/simplabs/excellent/parsing/case_context.rb', line 21

def tests_parameter?
  @tests_parameter
end