basic functions for object
This commit is contained in:
parent
9d711e7766
commit
c2b84925a4
@ -19,10 +19,38 @@ module Parfait
|
|||||||
@layout.get_class()
|
@layout.get_class()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# class stores the "latest" layout for instances, ir the layout a new object will
|
||||||
|
# be created with.
|
||||||
|
# inside parfait (and for now everywhere) these are constant.
|
||||||
|
@@EMPTY = { :names => [] , :types => []}
|
||||||
|
def self.class_layout()
|
||||||
|
@@EMPTY
|
||||||
|
end
|
||||||
|
|
||||||
def get_layout()
|
def get_layout()
|
||||||
@layout
|
@layout
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def instance_variables
|
||||||
|
@layout.instance_variables
|
||||||
|
end
|
||||||
|
|
||||||
|
def instance_variable_get name
|
||||||
|
index = instance_variable_defined(name)
|
||||||
|
return nil if index == nil
|
||||||
|
return internal_get(index)
|
||||||
|
end
|
||||||
|
|
||||||
|
def instance_variable_set name , value
|
||||||
|
index = instance_variable_defined(name)
|
||||||
|
return nil if index == nil
|
||||||
|
return internal_set(index , value)
|
||||||
|
end
|
||||||
|
|
||||||
|
def instance_variable_defined name
|
||||||
|
@layout.index_of(name)
|
||||||
|
end
|
||||||
|
|
||||||
# Object
|
# Object
|
||||||
# :nil?, :===, :=~, :!~, :eql?, :hash, :<=>, :class, :singleton_class, :clone, :dup, :taint, :tainted?, :untaint,
|
# :nil?, :===, :=~, :!~, :eql?, :hash, :<=>, :class, :singleton_class, :clone, :dup, :taint, :tainted?, :untaint,
|
||||||
# :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods,
|
# :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods,
|
||||||
|
Loading…
Reference in New Issue
Block a user