Class: XfOOrth::ClassSpec

Inherits:
AbstractWordSpec show all
Defined in:
lib/fOOrth/compiler/word_specs.rb

Overview

A class used to specify the compile of fOOrth classes.

Instance Attribute Summary collapse

Attributes inherited from AbstractWordSpec

#builds, #does, #tags

Instance Method Summary collapse

Methods inherited from AbstractWordSpec

#get_info, #get_stub_action, #has_tag?, #initialize

Constructor Details

This class inherits a constructor from XfOOrth::AbstractWordSpec

Instance Attribute Details

#new_classObject (readonly)

Give read access to the class for testing.



121
122
123
# File 'lib/fOOrth/compiler/word_specs.rb', line 121

def new_class
  @new_class
end

Instance Method Details

#build_builds_string(new_class, _symbol) ⇒ Object

Generate the Ruby code for this fOOrth class.
Parameters:

  • new_class - The class object being specified.

  • _symbol - The symbol that the name maps to. Unused



115
116
117
118
# File 'lib/fOOrth/compiler/word_specs.rb', line 115

def build_builds_string(new_class, _symbol)
  @new_class = new_class
  @builds = "vm.push(#{new_class.name}); "
end