Sha256: a19ba2b9f0ccfb0c8b2b17fa56729eadae7950e5c72c76d7006fc7a72bf4f731

Contents?: true

Size: 408 Bytes

Versions: 2

Compression:

Stored size: 408 Bytes

Contents

module Ice
    module Cubeable
      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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ice-0.2.2 lib/ice/cubeable.rb
ice-0.2.1 lib/ice/cubeable.rb