Class: HackStatement
- Defined in:
- lib/core/statement/HackStatement.rb
Overview
This is a temporary statement that simple writes out the string provided to it. It is used by the RuntimeTrackingMethod and is simple used now because I am not able to create hashes just yet. I hope to remove this class in the foreseable future(15/07/09) - lets see.
Instance Attribute Summary
Attributes inherited from Statement
#overrides, #scope, #statement_id, #statement_level
Instance Method Summary collapse
- #copy ⇒ Object
-
#initialize(statement_text) ⇒ HackStatement
constructor
A new instance of HackStatement.
- #write(tab = 0) ⇒ Object
Methods inherited from Statement
#[], #[]=, #add, #assignment?, #cauldron_method_calls, #clear, #confirmed?, #contains_method_call?, #context_variable, #contextual_variable, #created_variable, #created_variable_id, #creates_variable?, #decalares_variable?, #declared_variable, #declared_variable_id, #describe, #each, #each_unrealised_variable, #each_untyped_variable, #each_variable, #each_with_index, #equivalent?, #exchange_variables, #find_actual_variable, #find_all_required_runtime_methods, #find_overriding_statements, #find_statement, #find_variable, #first, #has?, #identify_overriding_statements, #is_simple?, #last, #left_hand_side, #length, #literalise, #map_to, #not_declared_variables, #overrides?, #push, #realise2, #realised?, #replace_variable!, #replace_variable_if, #required_variable_ids, reset_global_id, #right_hand_side, #same_not_declared_variables?, #select_all, #statement_count, #subst, #subst!, #subst_variable!, #to_declaration, #to_literal_string, #to_var, #tokens, #unrealised_variables, #untyped_variables, #valid_syntax?, #variables, #write_with_uniq_id, #write_with_value, #write_with_variable_id
Methods included from ActsAsCode
Methods included from ActsAsStatement
#classes_match?, #statement_type
Methods included from PrintVariables
Constructor Details
#initialize(statement_text) ⇒ HackStatement
Returns a new instance of HackStatement.
8 9 10 11 12 13 |
# File 'lib/core/statement/HackStatement.rb', line 8 def initialize(statement_text) super() @statement_text = statement_text @confirmed = true @statement_type = 'Hack' end |
Instance Method Details
#copy ⇒ Object
21 22 23 |
# File 'lib/core/statement/HackStatement.rb', line 21 def copy return HackStatement.new(@statement_text.dup) end |
#write(tab = 0) ⇒ Object
15 16 17 18 19 |
# File 'lib/core/statement/HackStatement.rb', line 15 def write(tab=0) l = '' tab.times {|x| l += "\t" } return l+@statement_text end |