Class: This
Overview
Not sure how or is this class will be used but it is meant as contextual reference to a different instance.
TODO Check whether this needs to be an array
Instance Method Summary collapse
- #copy ⇒ Object
- #declaration_statement ⇒ Object
- #describe(context = nil, variable = nil) ⇒ Object
-
#initialize(*parameters) ⇒ This
constructor
A new instance of This.
- #write(context = nil, variable = nil) ⇒ Object
Methods inherited from Array
#cauldron_method_calls, #contains?, #select_all, #to_declaration, #to_intrinsic, #to_literal, #to_var
Constructor Details
#initialize(*parameters) ⇒ This
Returns a new instance of This.
12 13 14 15 16 17 |
# File 'lib/core/syntax/This.rb', line 12 def initialize(*parameters) super() # Save any requirements parameters.collect {|param| self.push param} end |
Instance Method Details
#declaration_statement ⇒ Object
36 37 38 |
# File 'lib/core/syntax/This.rb', line 36 def declaration_statement return ClassMethodCallContainer.new(ThisClass.new,New.new) end |
#describe(context = nil, variable = nil) ⇒ Object
28 29 30 |
# File 'lib/core/syntax/This.rb', line 28 def describe(context=nil,variable=nil) return write(context,variable)+"\n" end |
#write(context = nil, variable = nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/core/syntax/This.rb', line 22 def write(context=nil,variable=nil) if context.nil? then return 'self' end if variable.nil? then return 'self' end return context.display_name_for(variable) end |