Sha256: e0b54444b9b5a0c9952226b17726d30cb4abfc1a88bb57aed2688743f48938e6

Contents?: true

Size: 816 Bytes

Versions: 1

Compression:

Stored size: 816 Bytes

Contents

module FbGraph
  class Link < Node
    include Connections::Comments

    attr_accessor :from, :link, :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
      @link        = attributes[:link]
      @caption     = attributes[:caption]
      @description = attributes[:description]
      @icon        = attributes[:icon]
      @picture     = attributes[:picture]
      @message     = attributes[:message]
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-0.7.1 lib/fb_graph/link.rb