Sha256: 23de4072267f6d3f5e050a0923a2067763c53bfa8b43e4f23d87872596e5fa04

Contents?: true

Size: 746 Bytes

Versions: 63

Compression:

Stored size: 746 Bytes

Contents

module FbGraph
  class Message < Node
    # TODO:
    # include Connections::Attachments
    # include Connections::Shares
    include Connections::Tags

    attr_accessor :message, :from, :to, :created_time

    def initialize(identifier, attributes = {})
      super
      @message = attributes[:message]
      if (from = attributes[:from])
        @from = User.new(from[:id], from)
      end
      @to = []
      if attributes[:to]
        Collection.new(attributes[:to]).each do |to|
          @to << User.new(to[:id], to)
        end
      end
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end

      # cached connection
      cache_collection attributes, :tags
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
fb_graph-2.7.17 lib/fb_graph/message.rb
fb_graph-2.7.16 lib/fb_graph/message.rb
fb_graph-2.7.15 lib/fb_graph/message.rb
fb_graph-2.7.14 lib/fb_graph/message.rb
fb_graph-2.7.13 lib/fb_graph/message.rb
fb_graph-2.7.12 lib/fb_graph/message.rb
fb_graph-2.7.11 lib/fb_graph/message.rb
fb_graph-2.7.10 lib/fb_graph/message.rb
fb_graph-2.7.9 lib/fb_graph/message.rb
fb_graph-2.7.8 lib/fb_graph/message.rb
fb_graph-2.7.7 lib/fb_graph/message.rb
fb_graph-2.7.6 lib/fb_graph/message.rb
fb_graph-2.7.5 lib/fb_graph/message.rb
fb_graph-2.7.4 lib/fb_graph/message.rb
fb_graph-2.7.3 lib/fb_graph/message.rb
fb_graph-2.7.2 lib/fb_graph/message.rb
fb_graph-2.7.1 lib/fb_graph/message.rb
fb_graph-2.7.0 lib/fb_graph/message.rb
fb_graph-2.6.7 lib/fb_graph/message.rb
fb_graph-2.6.6 lib/fb_graph/message.rb