Class: Tumblr::Photo

Inherits:
Post show all
Defined in:
lib/tumblr/objects/photo.rb

Defined Under Namespace

Classes: Size

Instance Method Summary collapse

Methods inherited from Post

build, #commit, find, #html?, #markdown?, page, per_page, #slug, tagged_with, #to_param, type

Methods inherited from Object

array_attribute, #as_json, attributes, boolean_attribute, build, #commit, date_attribute, #dom_class, #etag, numeric_attribute, object_attribute, objectify, #serialize, #storage, string_attribute, systematize, #to_json, unserialize

Instance Method Details

#photos=(value) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/tumblr/objects/photo.rb', line 13

def photos=(value)
  photos = value.collect do |value|
    object = Tumblr::Photo.new
    object.caption = value["caption"]
    object.sizes = value["alt_sizes"].collect { |size| Size.build(size) }
  end
  set_attribute_value(:photos, photos)
end