Class: Concordion::Binder

Inherits:
Object
  • Object
show all
Includes:
Utility
Defined in:
lib/concordion/binder.rb

Instance Method Summary collapse

Methods included from Utility

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

Methods included from StringUtility

#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 Constants

#concordion_command_attributes, #supported?

Constructor Details

#initialize(concordion) ⇒ Binder

Returns a new instance of Binder.



7
8
9
# File 'lib/concordion/binder.rb', line 7

def initialize(concordion)
  @concordion = concordion
end

Instance Method Details

#bind_if_set_command(cpr) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/concordion/binder.rb', line 10

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



19
20
21
22
23
# File 'lib/concordion/binder.rb', line 19

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