Sha256: 5d0ff0c2e253ac150208a9d0ecb3343391a39dc58bb76981701467b14ddc4fa4
Contents?: true
Size: 1.49 KB
Versions: 12
Compression:
Stored size: 1.49 KB
Contents
module FbGraph class Post < Node include Connections::Comments attr_accessor :from, :to, :message, :picture, :link, :name, :caption, :description, :source, :icon, :attribution, :actions, :likes, :created_time, :updated_time def initialize(identifier, options = {}) super if (from = options[:from]) @from = if from[:category] FbGraph::Page.new(from.delete(:id), from) else FbGraph::User.new(from.delete(:id), from) end end @to = [] if options[:to] FbGraph::Collection.new(options[:to]).each do |to| @to << if to[:category] FbGraph::Page.new(to.delete(:id), to) else FbGraph::User.new(to.delete(:id), to) end end end @message = options[:message] @picture = options[:picture] @link = options[:link] @name = options[:name] @caption = options[:caption] @description = options[:description] @source = options[:source] @icon = options[:icon] @attribution = options[:attribution] @actions = options[:actions] @likes = options[:likes] if options[:created_time] @created_time = Time.parse(options[:created_time]).utc end if options[:updated_time] @updated_time = Time.parse(options[:updated_time]).utc end # cached connection @_comments_ = FbGraph::Collection.new(options[:comments]) end end end
Version data entries
12 entries across 12 versions & 1 rubygems