Class: Grin::Photo

Inherits:
Client show all
Defined in:
lib/grin/photo.rb

Constant Summary

Constants inherited from Client

Client::API_VERSION, Client::DOMAIN

Instance Method Summary collapse

Methods inherited from Client

#album, #albums, #categories, #category, #create_album, #create_category, #find_or_create_album, #find_or_create_category

Constructor Details

#initialize(data) ⇒ Photo

Returns a new instance of Photo.



4
5
6
7
8
9
10
11
# File 'lib/grin/photo.rb', line 4

def initialize(data)
  data.each do |key, value|
    instance_variable_set("@#{key}", value)
    Photo.instance_eval do
      attr_reader key.to_sym
    end
  end
end