Class: FbGraph::Note

Inherits:
Node
  • Object
show all
Includes:
Connections::Comments
Defined in:
lib/fb_graph/note.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods included from Connections::Comments

#comment!, #comments, #like!, #unlike!

Methods inherited from Node

#destroy, fetch, #fetch

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, options = {}) ⇒ Note

Returns a new instance of Note.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fb_graph/note.rb', line 7

def initialize(identifier, options = {})
  super
  if (from = options[:from])
    @from = if from[:category]
      FbGraph::Page.new(from.delete(:id), from)
    else
      FbGraph::User.new(from.delete(:id), from)
    end
  end
  @subject      = options[:subject]
  @message      = options[:message]
  if options[:created_time]
    @created_time = Time.parse(options[:created_time]).utc
  end
  if options[:updated_time]
    @updated_time = Time.parse(options[:updated_time]).utc
  end
end

Instance Attribute Details

#created_timeObject

Returns the value of attribute created_time.



5
6
7
# File 'lib/fb_graph/note.rb', line 5

def created_time
  @created_time
end

#fromObject

Returns the value of attribute from.



5
6
7
# File 'lib/fb_graph/note.rb', line 5

def from
  @from
end

#messageObject

Returns the value of attribute message.



5
6
7
# File 'lib/fb_graph/note.rb', line 5

def message
  @message
end

#subjectObject

Returns the value of attribute subject.



5
6
7
# File 'lib/fb_graph/note.rb', line 5

def subject
  @subject
end

#updated_timeObject

Returns the value of attribute updated_time.



5
6
7
# File 'lib/fb_graph/note.rb', line 5

def updated_time
  @updated_time
end