class Lisp::NativeObject
Public Class Methods
new(o=nil)
click to toggle source
# File lib/rubylisp/native_object.rb, line 13 def initialize(o=nil) @value = o end
new_instance_of(c)
click to toggle source
# File lib/rubylisp/native_object.rb, line 5 def self.new_instance_of(c) self.new(c.alloc.init) end
with_value(o)
click to toggle source
# File lib/rubylisp/native_object.rb, line 9 def self.with_value(o) self.new(o) end
Public Instance Methods
false?()
click to toggle source
# File lib/rubylisp/native_object.rb, line 41 def false? @value == nil end
native_type()
click to toggle source
# File lib/rubylisp/native_object.rb, line 29 def native_type @value.class end
object?()
click to toggle source
# File lib/rubylisp/native_object.rb, line 21 def object? true end
to_s()
click to toggle source
# File lib/rubylisp/native_object.rb, line 33 def to_s "<a #{@value.class}: #{@value}>" end
true?()
click to toggle source
# File lib/rubylisp/native_object.rb, line 37 def true? @value != nil end
type()
click to toggle source
# File lib/rubylisp/native_object.rb, line 25 def type :object end
with_value(&block)
click to toggle source
# File lib/rubylisp/native_object.rb, line 17 def with_value(&block) block.call(@value) end