Sha256: 4d0671131eaa65e425d1d2f51754217a7ff922ef882d16b08e30cd1898ee7199

Contents?: true

Size: 915 Bytes

Versions: 17

Compression:

Stored size: 915 Bytes

Contents

module FbGraph
  class Link < Node
    include Connections::Comments

    attr_accessor :from, :link, :name, :caption, :description, :icon, :picture, :message, :created_time

    def initialize(identifier, attributes = {})
      super
      if (from = attributes[:from])
        @from = if from[:category]
          FbGraph::Page.new(from.delete(:id), from)
        else
          FbGraph::User.new(from.delete(:id), from)
        end
      end
      @name        = attributes[:name]
      @link        = attributes[:link]
      @caption     = attributes[:caption]
      @description = attributes[:description]
      @icon        = attributes[:icon]
      @picture     = attributes[:picture] # NOTE: this is external image, so isn't connection.
      @message     = attributes[:message]
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
fb_graph-1.1.4 lib/fb_graph/link.rb
fb_graph-1.1.3 lib/fb_graph/link.rb
fb_graph-1.1.2 lib/fb_graph/link.rb
fb_graph-1.1.1 lib/fb_graph/link.rb
fb_graph-1.1.0 lib/fb_graph/link.rb
fb_graph-1.0.7 lib/fb_graph/link.rb
fb_graph-1.0.6 lib/fb_graph/link.rb
fb_graph-1.0.5 lib/fb_graph/link.rb
palidanx-fb_graph-1.0.4 lib/fb_graph/link.rb
fb_graph-1.0.4 lib/fb_graph/link.rb
fb_graph-1.0.3 lib/fb_graph/link.rb
fb_graph-1.0.2 lib/fb_graph/link.rb
fb_graph-1.0.1 lib/fb_graph/link.rb
fb_graph-1.0.0 lib/fb_graph/link.rb
fb_graph-0.8.0 lib/fb_graph/link.rb
fb_graph-0.7.3 lib/fb_graph/link.rb
fb_graph-0.7.2 lib/fb_graph/link.rb