Class: PincasterLayer

Inherits:
Object
  • Object
show all
Defined in:
lib/pincaster_layer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(layer_array) ⇒ PincasterLayer

Returns a new instance of PincasterLayer.



5
6
7
8
# File 'lib/pincaster_layer.rb', line 5

def initialize(layer_array)
  @layer_hash = layer_array.first
  splat_layer
end

Instance Attribute Details

#layer_hashObject (readonly)

Returns the value of attribute layer_hash.



3
4
5
# File 'lib/pincaster_layer.rb', line 3

def layer_hash
  @layer_hash
end

Instance Method Details

#splat_layerObject

provides an accessor for every pin value that came back from Pincaster



11
12
13
14
15
16
# File 'lib/pincaster_layer.rb', line 11

def splat_layer
  @layer_hash.each_pair do |key, value|
    self.class.send(:attr_accessor, key.to_sym)
    self.send(key.to_s + "=", value)
  end
end