class Sol::RuntimeModel::SolClass
Represents a Sol
class in the Ruby world. Classes are objects in Sol
so they inherit from SolObject
Attributes
runtime_methods[R]
Public Class Methods
new()
click to toggle source
Create a new class. Number is an instance of Class for example
Calls superclass method
# File lib/sol/runtime/class.rb, line 13 def initialize @runtime_methods = {} # Check if we're bootstrapping (launching the runtime). During this process the # runtime is not fully initialised and core classes do not yet exists, so we defer # using those once the language is bootstrapped. # This solves the chicken-or-the-egg problem with the Class class. We can # initialise Class then set Class.class = Class. if defined?(Runtime) # RuntimeModel is a temporary name runtime_class = Runtime["Class"] else runtime_class = nil end super(runtime_class) end
Public Instance Methods
lookup(method_name)
click to toggle source
Lookup a method
# File lib/sol/runtime/class.rb, line 37 def lookup(method_name) method = @runtime_methods[method_name] unless method raise "Method not found: #{method_name}" end return method end
new()
click to toggle source
Create a new instance of the class
# File lib/sol/runtime/class.rb, line 52 def new SolObject.new(self) end
new_with_value(value)
click to toggle source
Create an instance of this Sol
class that holds a Ruby value
# File lib/sol/runtime/class.rb, line 59 def new_with_value(value) SolObject.new(self, value) end