Class: Object

Inherits:
BasicObject
Defined in:
lib/ripple/core_ext/casting.rb,
lib/ripple/core_ext/object.rb,
lib/ripple/core_ext/indexes.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ripple_cast(value) ⇒ Object



17
18
19
# File 'lib/ripple/core_ext/casting.rb', line 17

def self.ripple_cast(value)
  value
end

Instance Method Details

#define_singleton_method(name, &block) ⇒ Object



3
4
5
6
# File 'lib/ripple/core_ext/object.rb', line 3

def define_singleton_method(name, &block)
  singleton_class = class << self; self; end
  singleton_class.send(:define_method, name, &block)
end

#to_ripple_index(type) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/ripple/core_ext/indexes.rb', line 14

def to_ripple_index(type)
  case type
  when 'bin'
    to_s
  when 'int'
    to_i
  end
end