Class: Ice::BaseCube

Inherits:
Object show all
Extended by:
CubeAssociation
Defined in:
lib/ice/base_cube.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CubeAssociation

belongs_to, has_many

Constructor Details

#initialize(source) ⇒ BaseCube

Returns a new instance of BaseCube.



20
21
22
# File 'lib/ice/base_cube.rb', line 20

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Class Method Details

.revealing(*attributes) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/ice/base_cube.rb', line 5

def self.revealing(* attributes)
  attributes.each do |attr|

    define_method attr.to_sym do
      @source.send(attr).to_ice
    end
  end
end

Instance Method Details

#to_iceObject



16
17
18
# File 'lib/ice/base_cube.rb', line 16

def to_ice
  self
end