Sha256: 73093ec968609ca42e9b1ebb10c7023aa501cad5dc46f91eeffe5c30b04e1b57

Contents?: true

Size: 1.15 KB

Versions: 28

Compression:

Stored size: 1.15 KB

Contents

module FbGraph
  class Video < Node
    include Connections::Comments
    include Connections::Likes
    include Connections::Picture

    attr_accessor :from, :tags, :name, :description, :embed_html, :icon, :source, :created_time, :updated_time

    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
      @tags = []
      if attributes[:tags]
        Collection.new(attributes[:tags]).each do |tag|
          @tags << Tag.new(tag)
        end
      end
      @name        = attributes[:name]
      @description = attributes[:description]
      @embed_html  = attributes[:embed_html]
      @icon        = attributes[:icon]
      @source      = attributes[:source]
      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
      @_comments_ = Collection.new(attributes[:comments])
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
fb_graph-2.2.0.alpha2 lib/fb_graph/video.rb
fb_graph-2.2.0.alpha lib/fb_graph/video.rb
fb_graph-2.1.13 lib/fb_graph/video.rb
fb_graph-2.1.12 lib/fb_graph/video.rb
fb_graph-2.1.11 lib/fb_graph/video.rb
fb_graph-2.1.10 lib/fb_graph/video.rb
fb_graph-2.1.9 lib/fb_graph/video.rb
fb_graph-2.1.8 lib/fb_graph/video.rb
fb_graph-2.1.7 lib/fb_graph/video.rb
fb_graph-2.1.6 lib/fb_graph/video.rb
fb_graph-2.1.5 lib/fb_graph/video.rb
fb_graph-2.1.4 lib/fb_graph/video.rb
fb_graph-2.1.3 lib/fb_graph/video.rb
fb_graph-2.1.2 lib/fb_graph/video.rb
fb_graph-2.1.1 lib/fb_graph/video.rb
fb_graph-2.1.0 lib/fb_graph/video.rb
fb_graph-2.1.0.alpha lib/fb_graph/video.rb
fb_graph-2.0.2 lib/fb_graph/video.rb
fb_graph-2.0.1 lib/fb_graph/video.rb
fb_graph-2.0.0 lib/fb_graph/video.rb