Class: Whatser::CheckIn

Inherits:
Resource show all
Defined in:
lib/whatser/resources/check_in.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#api_request, api_request, client, convert_data_to_model, from_hash_to_model, #initialize, set

Constructor Details

This class inherits a constructor from Whatser::Resource

Instance Attribute Details

#check_in_atObject

Returns the value of attribute check_in_at.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def check_in_at
  @check_in_at
end

#check_out_atObject

Returns the value of attribute check_out_at.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def check_out_at
  @check_out_at
end

#foursquare_shareObject

Returns the value of attribute foursquare_share.



5
6
7
# File 'lib/whatser/resources/check_in.rb', line 5

def foursquare_share
  @foursquare_share
end

#gowalla_shareObject

Returns the value of attribute gowalla_share.



5
6
7
# File 'lib/whatser/resources/check_in.rb', line 5

def gowalla_share
  @gowalla_share
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/whatser/resources/check_in.rb', line 3

def id
  @id
end

#latObject

Returns the value of attribute lat.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def lat
  @lat
end

#lngObject

Returns the value of attribute lng.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def lng
  @lng
end

#locate_userObject

Returns the value of attribute locate_user.



5
6
7
# File 'lib/whatser/resources/check_in.rb', line 5

def locate_user
  @locate_user
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def message
  @message
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def name
  @name
end

#poi_idObject

Returns the value of attribute poi_id.



3
4
5
# File 'lib/whatser/resources/check_in.rb', line 3

def poi_id
  @poi_id
end

#ratingObject

Returns the value of attribute rating.



4
5
6
# File 'lib/whatser/resources/check_in.rb', line 4

def rating
  @rating
end

#user_idObject

Returns the value of attribute user_id.



3
4
5
# File 'lib/whatser/resources/check_in.rb', line 3

def user_id
  @user_id
end

Class Method Details

.create(poi_id, params = {}) ⇒ Object



12
13
14
# File 'lib/whatser/resources/check_in.rb', line 12

def create(poi_id, params={})
  api_request :post, "/api/poi/#{poi_id}/check_ins", {:body => {'check_in' => params} }
end

.list(opts = {}) ⇒ Object



8
9
10
# File 'lib/whatser/resources/check_in.rb', line 8

def list(opts={})
  api_request :get, "/api/check_ins", {:query => opts}
end

Instance Method Details

#saveObject



17
18
19
# File 'lib/whatser/resources/check_in.rb', line 17

def save
  self.class.create( self.poi_id, self.to_params )
end

#to_paramsObject



21
22
23
# File 'lib/whatser/resources/check_in.rb', line 21

def to_params
  {:lat => lat, :lng => lng, :locate => locate_user, :gowalla => gowalla_share, :foursquare => foursquare_share, :check_in_at => check_in_at, :check_out_at => check_out_at}
end