Class: Object

Inherits:
BasicObject
Defined in:
lib/rextra/cutting.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/rextra/cutting.rb', line 8

def blank?
  if    respond_to? :empty? then empty?
  elsif respond_to? :zero?  then zero?
  else !self
  end
end

#class_def(name, &blk) ⇒ Object



5
6
7
# File 'lib/rextra/cutting.rb', line 5

def class_def name, &blk
  self.class.class_eval { define_method name, &blk }
end

#metaObject



2
# File 'lib/rextra/cutting.rb', line 2

def meta() class << self; self end end

#meta_def(name, &blk) ⇒ Object



4
# File 'lib/rextra/cutting.rb', line 4

def meta_def(name, &blk) meta_eval { define_method name, &blk } end

#meta_eval(&blk) ⇒ Object



3
# File 'lib/rextra/cutting.rb', line 3

def meta_eval(&blk) meta.instance_eval( &blk ) end