Class: FbGraph::Checkin
- Extended by:
- Searchable
- Includes:
- FbGraph::Connections::Comments, FbGraph::Connections::Likes, FbGraph::Connections::Likes::Likable
- Defined in:
- lib/fb_graph/checkin.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#message ⇒ Object
Returns the value of attribute message.
-
#place ⇒ Object
Returns the value of attribute place.
-
#tags ⇒ Object
Returns the value of attribute tags.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Checkin
constructor
A new instance of Checkin.
Methods included from Searchable
Methods included from FbGraph::Connections::Likes::Likable
Methods included from FbGraph::Connections::Likes
Methods included from FbGraph::Connections::Comments
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Checkin
Returns a new instance of Checkin.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fb_graph/checkin.rb', line 10 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = User.new(from[:id], from) end @tags = [] if ( = attributes[:tags]) case when Hash Collection.new().each do |user| @tags << User.new(user[:id], user) end when String, Array Array().each do |user_id| @tags << User.new(user_id) end end end if (place = attributes[:place]) @place = case place when Place place when String, Integer Place.new(place) when Hash Place.new(place[:id], place) end end @message = attributes[:message] if (application = attributes[:application]) @application = Application.new(application[:id], application) end if (created_time = attributes[:created_time]) @created_time = Time.parse(created_time).utc end end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def application @application end |
#created_time ⇒ Object
Returns the value of attribute created_time.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def from @from end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def @message end |
#place ⇒ Object
Returns the value of attribute place.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def place @place end |
#tags ⇒ Object
Returns the value of attribute tags.
8 9 10 |
# File 'lib/fb_graph/checkin.rb', line 8 def @tags end |
Class Method Details
.search(options = {}) ⇒ Object
47 48 49 |
# File 'lib/fb_graph/checkin.rb', line 47 def self.search( = {}) super(nil, ) end |