Class: FbGraph::Review

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/review.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ Review

Returns a new instance of Review.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fb_graph/review.rb', line 5

def initialize(identifier, attributes = {})
  super

  @from = if (from = attributes[:from])
    User.new from[:id], from
  end
  @to = if (to = attributes[:to])
    Application.new to[:id], to
  end
  @message = attributes[:message]
  @rating = attributes[:rating]

  if attributes[:created_time]
    @created_time = Time.parse(attributes[:created_time]).utc
  end
end

Instance Attribute Details

#created_timeObject

Returns the value of attribute created_time.



3
4
5
# File 'lib/fb_graph/review.rb', line 3

def created_time
  @created_time
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/fb_graph/review.rb', line 3

def from
  @from
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/fb_graph/review.rb', line 3

def message
  @message
end

#ratingObject

Returns the value of attribute rating.



3
4
5
# File 'lib/fb_graph/review.rb', line 3

def rating
  @rating
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/fb_graph/review.rb', line 3

def to
  @to
end