Sha256: ec7620cbcb85eb374adea3e12096584c2fc9227a60643c2f188edf5f6cd73220

Contents?: true

Size: 871 Bytes

Versions: 28

Compression:

Stored size: 871 Bytes

Contents

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

    attr_accessor :subject, :message, :from, :to, :tags, :created_time

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
fb_graph-1.8.0 lib/fb_graph/message.rb
fb_graph-1.8.0.alpha2 lib/fb_graph/message.rb
fb_graph-1.7.5 lib/fb_graph/message.rb
fb_graph-1.8.0.alpha lib/fb_graph/message.rb
fb_graph-1.7.4 lib/fb_graph/message.rb
fb_graph-1.7.3 lib/fb_graph/message.rb
fb_graph-1.7.2 lib/fb_graph/message.rb
fb_graph-1.7.1 lib/fb_graph/message.rb
fb_graph-1.7.0 lib/fb_graph/message.rb
fb_graph-1.7.0.alpha2 lib/fb_graph/message.rb
fb_graph-1.6.9 lib/fb_graph/message.rb
fb_graph-1.7.0.alpha lib/fb_graph/message.rb
fb_graph-1.6.8 lib/fb_graph/message.rb
fb_graph-1.6.7 lib/fb_graph/message.rb
fb_graph-1.6.5 lib/fb_graph/message.rb
fb_graph-1.6.4 lib/fb_graph/message.rb
fb_graph-1.6.3 lib/fb_graph/message.rb
fb_graph-1.6.2 lib/fb_graph/message.rb
fb_graph-1.6.1 lib/fb_graph/message.rb
fb_graph-1.6.0 lib/fb_graph/message.rb