Class: ConcordionBinder

Inherits:
Object
  • Object
show all
Includes:
ConcordionUtility
Defined in:
lib/concordion_binder.rb

Instance Method Summary collapse

Methods included from ConcordionUtility

#concordion_arguments, #concordion_cmd_attr_exists?, #concordion_cmd_attr_for, #concordion_property_reference, #concordion_variable_name, #has_property_reference?, #instrumentation, #supported_and_instrumented?

Methods included from ConcordionConvenience

#methods_for

Methods included from ConcordionStringUtility

#assignment, #attr_writer_method?, #concordion_assignment, #concordion_method_name, #ends_in_empty_parens?, #escape_single_quotes, #has_arguments?, #has_assignment?, #is_direct_method_call?

Methods included from PluralToSingularUtility

#singular

Methods included from SnakeCaseUtility

#snake_case, #snake_cased_goldmaster_name, #snake_cased_test_name

Methods included from ConcordionConstants

#concordion_command_attributes, #supported?

Constructor Details

#initialize(concordion) ⇒ ConcordionBinder

Returns a new instance of ConcordionBinder.



6
7
8
# File 'lib/concordion_binder.rb', line 6

def initialize(concordion)
  @concordion = concordion
end

Instance Method Details

#bind_if_set_command(cpr) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/concordion_binder.rb', line 9

def bind_if_set_command(cpr)
  if cpr.is_set_command?
    @concordion.set_variable(cpr.system_under_test, cpr.content)
    true
  else
    false
  end
end

#handle_assignment(cpr, sut_rv) ⇒ Object



18
19
20
21
22
# File 'lib/concordion_binder.rb', line 18

def handle_assignment(cpr, sut_rv)
  if has_assignment?(cpr.system_under_test)
    @concordion.set_variable(concordion_assignment(cpr.system_under_test), sut_rv)
  end
end