Module: Ice::Cubeable

Defined in:
lib/ice/cubeable.rb

Instance Method Summary collapse

Instance Method Details

#get_cube_class(class_obj) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ice/cubeable.rb', line 3

def get_cube_class(class_obj)
  begin
    cube_string = class_obj.to_s + "Cube"
    puts "getting string #{cube_string}"
    cube_string.constantize
  rescue
    get_cube_class class_obj.superclass
  end
end

#to_iceObject



13
14
15
16
# File 'lib/ice/cubeable.rb', line 13

def to_ice
  cube_class = get_cube_class self.class
  cube_class.new self
end