Module: Smartfm::PublicContent::ClassMethods

Defined in:
lib/smartfm/modules/public_content.rb

Instance Method Summary collapse

Instance Method Details

#create(auth, params = {}) ⇒ Object



26
27
28
# File 'lib/smartfm/modules/public_content.rb', line 26

def create(auth, params = {})
  self.new(params).save(auth)
end

#delete(obj_id) ⇒ Object



30
31
32
# File 'lib/smartfm/modules/public_content.rb', line 30

def delete(obj_id)
  self.find(obj_id).delete
end

#find(obj_id, params = {}) ⇒ Object



14
15
16
17
18
# File 'lib/smartfm/modules/public_content.rb', line 14

def find(obj_id, params = {})
  params[:id] = obj_id
  hash = self.rest_client.find(params)
  self.deserialize(hash)
end

#matching(keyword, params = {}) ⇒ Object



20
21
22
23
24
# File 'lib/smartfm/modules/public_content.rb', line 20

def matching(keyword, params = {})
  params[:keyword] = keyword
  hash = self.rest_client.matching(params)
  self.deserialize(hash) || []
end

#recent(params = {}) ⇒ Object



9
10
11
12
# File 'lib/smartfm/modules/public_content.rb', line 9

def recent(params = {})
  hash = self.rest_client.recent(params)
  self.deserialize(hash) || []
end