Class: Whatser::Tag

Inherits:
Resource show all
Defined in:
lib/whatser/resources/tag.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

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#poi_idObject

Returns the value of attribute poi_id.



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

def poi_id
  @poi_id
end

#touch_detail_picObject

Returns the value of attribute touch_detail_pic.



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

def touch_detail_pic
  @touch_detail_pic
end

#touch_list_picObject

Returns the value of attribute touch_list_pic.



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

def touch_list_pic
  @touch_list_pic
end

#wap_detail_picObject

Returns the value of attribute wap_detail_pic.



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

def wap_detail_pic
  @wap_detail_pic
end

#wap_list_picObject

Returns the value of attribute wap_list_pic.



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

def wap_list_pic
  @wap_list_pic
end

#web_detail_picObject

Returns the value of attribute web_detail_pic.



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

def web_detail_pic
  @web_detail_pic
end

#web_list_picObject

Returns the value of attribute web_list_pic.



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

def web_list_pic
  @web_list_pic
end

Class Method Details

.create(poi_id, tag_name) ⇒ Object



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

def create(poi_id, tag_name)
  api_request :post, "/api/poi/#{poi_id}/tags", {:body => {'tagging' => {'name' => tag_name}} }
end

.delete(poi_id, tag_name) ⇒ Object



16
17
18
# File 'lib/whatser/resources/tag.rb', line 16

def delete(poi_id, tag_name)
  api_request :delete, "/api/poi/#{poi_id}/tags/#{tag_name}"
end

.list(poi_id, opts = {}) ⇒ Object



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

def list(poi_id, opts={})
  api_request :get, "/api/poi/#{poi_id}/tags", {:query => opts}
end

Instance Method Details

#deleteObject



25
26
27
# File 'lib/whatser/resources/tag.rb', line 25

def delete
  self.class.delete(poi_id, name)
end

#saveObject



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

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

#to_paramsObject



29
30
31
# File 'lib/whatser/resources/tag.rb', line 29

def to_params
  {:name => name}
end