Sha256: 3dc61c0f0ce3beaaae33bd8ba8a584d305b36ec08bb552d55de095f926487c72

Contents?: true

Size: 575 Bytes

Versions: 3

Compression:

Stored size: 575 Bytes

Contents

module Smirk
  class Album < Client
    
    def initialize(info)
      info.each do |key, value|
        instance_variable_set("@#{key}", value)
        Album.instance_eval do
          attr_reader key.to_sym
        end
      end
    end
    
    def images(heavy = false)
      params = default_params.merge!({:method => "smugmug.images.get", :AlbumID => id, :AlbumKey => key, :Heavy => heavy})
      json = get(params)["Album"]["Images"]
      json.inject([]) do |images, i|
        images << Smirk::Image.new(upper_hash_to_lower_hash(i))
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smirk-0.3.0 lib/smirk/album.rb
smirk-0.2.4 lib/smirk/album.rb
smirk-0.2.2 lib/smirk/album.rb