Sha256: c83ab37dabccdf751fec2ddd54189b44ff741e7e7d76ece5cf3ec15d76d1689a

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

module FbGraph
  class Post < Node
    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[:id], :name => from[:name], :category => from[:category]) 
        else
          FbGraph::User.new(from[:id], :name => from[:name])
        end
      end
      @to = []
      if options[:to]
        options[:to].each do |to|
          @to << if to[:category]
            FbGraph::Page.new(to[:id], :name => to[:name], :category => to[:category]) 
          else
            FbGraph::User.new(to[:id], :name => to[:name])
          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]
      @created_time = options[:created_time]
      @updated_time = options[:updated_time]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-0.0.1 lib/fb_graph/post.rb