Sha256: e26e18fecde5e302de9773e8ccfe8d99526101dd75384a02abcf40d385e2fbd8

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

module FbGraph
  class Note < Node
    include Connections::Comments
    include Connections::Likes
    include Connections::Likes::Likable

    attr_accessor :from, :subject, :message, :created_time, :updated_time, :icon

    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
      @subject = attributes[:subject]
      @message = attributes[:message]
      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
      @icon = attributes[:icon]

      # cached connection
      @_comments_ = Collection.new(attributes[:comments])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-2.2.2 lib/fb_graph/note.rb
fb_graph-2.2.1 lib/fb_graph/note.rb
fb_graph-2.2.0 lib/fb_graph/note.rb
fb_graph-2.2.0.beta lib/fb_graph/note.rb