class Object

Easier instance variable getters that do the variable naming/symbol for you

Some methods to make meta definitions easier

This can make not nil checks look nicer depending on the objects

Public Instance Methods

__class_ivg(name) click to toggle source
# File lib/deployable/patch/instance_class_variables.rb, line 13
def __class_ivg name
  self.class.__ivg name
end
__class_ivs(name, value) click to toggle source
# File lib/deployable/patch/instance_class_variables.rb, line 17
def __class_ivs name, value
  self.class.__ivs name, value
end
__ivg(name) click to toggle source
# File lib/deployable/patch/instance_class_variables.rb, line 5
def __ivg name
  instance_variable_get :"@#{name}" 
end
__ivs(name, value) click to toggle source
# File lib/deployable/patch/instance_class_variables.rb, line 9
def __ivs name, value
  instance_variable_set :"@#{name}", value
end
class_def( name, &blk ) click to toggle source

Defines an instance method within a class

# File lib/deployable/patch/meta.rb, line 15
def class_def( name, &blk )
  class_eval { define_method name, &blk }
end
ensure_array() click to toggle source
# File lib/deployable/patch/ensure_array.rb, line 2
def ensure_array; [self] end
meta_def( name, &blk ) click to toggle source

Adds methods to a metaclass

# File lib/deployable/patch/meta.rb, line 10
def meta_def( name, &blk )
  meta_eval { define_method name, &blk }
end
meta_eval(&blk;) click to toggle source
# File lib/deployable/patch/meta.rb, line 7
def meta_eval &blk; metaclass.instance_eval( &blk ); end
metaclass() click to toggle source

The hidden singleton lurks behind everyone

# File lib/deployable/patch/meta.rb, line 6
def metaclass; class << self; self; end; end
not_nil?() click to toggle source
# File lib/deployable/patch/not_nil.rb, line 3
def not_nil?
  !nil?
end