hacks/private_instance_vars |
class Object < Object |
TODO: I'm not 100% convinced that this works as it should.
TODO: Private instance variables do not get properly marshalled at the moment.
Example:
class Foo private_instance_var :foodef initialize set_piv :foo, 42 end
def bar get_piv :foo end end
f = Foo.new p f.bar #=> 42
Constants |
INSTANCE_VARS |
---|
Public Methods |
Define a new private instance variable in the current class.
symbol | the name of the instance variable |
---|
Return the private instance variable associated with symbol.
symbol | the name of the private instance variable to return |
---|
Returns: the private instance variable
Set the private instance variable associated with symbol.
symbol | the name of the private instance variable to return |
---|---|
value | the new value |
Returns: value
get_piv is an alias for get_private_instance_var.
set_piv is an alias for set_private_instance_var.