Class: ActionImplementation

Inherits:
TheoryAction show all
Defined in:
lib/theory/ActionImplementation.rb

Instance Attribute Summary collapse

Attributes inherited from TheoryAction

#action

Attributes included from TheoryComponent

#theory_component_id

Instance Method Summary collapse

Methods inherited from TheoryAction

#describe, #map_to, #statements_with_variable, #theory_variables

Methods included from TheoryComponent

#accessors, #generate_theory_component_id, #statements_with_variable, #theory_variables, #tokens

Methods included from ActsAsCode

#write_structure

Constructor Details

#initialize(statement, target_id, theory_component_id = nil) ⇒ ActionImplementation

Returns a new instance of ActionImplementation.



5
6
7
# File 'lib/theory/ActionImplementation.rb', line 5

def initialize(statement,target_id,theory_component_id=nil)
  super(statement,target_id,theory_component_id)
end

Instance Attribute Details

#target_idObject (readonly)

Returns the value of attribute target_id.



3
4
5
# File 'lib/theory/ActionImplementation.rb', line 3

def target_id
  @target_id
end

Instance Method Details

#copyObject



9
10
11
# File 'lib/theory/ActionImplementation.rb', line 9

def copy
  return ActionImplementation.new(@action.copy,@target_id.copy,@theory_component_id)
end

#write(tab = 0) ⇒ Object



13
14
15
# File 'lib/theory/ActionImplementation.rb', line 13

def write(tab=0)
  return ("\t"*tab)+"runtime_method.add_statement_at(#{@action.write},#{@target_id.write})"
end