Sha256: e01ffc7b6cd17d8724f8743d79085fb038a254202ef6588567ca8e28292e8f6c
Contents?: true
Size: 1.45 KB
Versions: 22
Compression:
Stored size: 1.45 KB
Contents
module FbGraph class Photo < Node include Connections::Comments include Connections::Likes include Connections::Likes::Likable include Connections::Picture include Connections::Tags include Connections::Tags::Taggable attr_accessor :from, :name, :icon, :source, :height, :width, :images, :link, :created_time, :updated_time, :position def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] Page.new(from[:id], from) else User.new(from[:id], from) end end # NOTE: # for some reason, facebook uses different parameter names. # "name" in GET & "message" in POST @name = attributes[:name] || attributes[:message] @icon = attributes[:icon] @source = attributes[:source] @height = attributes[:height] @width = attributes[:width] @link = attributes[:link] @position = attributes[:position] @images = [] if attributes[:images] attributes[:images].each do |image| @images << Image.new(image) end end if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end # cached connection cache_collections attributes, :comments, :tags end end end
Version data entries
22 entries across 22 versions & 1 rubygems