Class: Podio::Search

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/search.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes, #error_code, #error_message, #error_parameters, #error_propagate

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, list, member, #new_record?, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.globally(words, attributes = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/podio/models/search.rb', line 28

def globally(words, attributes={})
  attributes[:query] = words
  response = Podio.connection.post do |req|
    req.url "/search/"
    req.body = attributes
  end

  list response.body
end

.in_app(app_id, words, attributes = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/podio/models/search.rb', line 48

def in_app(app_id, words, attributes={})
  attributes[:query] = words
  response = Podio.connection.post do |req|
    req.url "/search/app/#{app_id}/"
    req.body = attributes
  end

  list response.body
end

.in_org(org_id, words) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/podio/models/search.rb', line 19

def in_org(org_id, words)
  response = Podio.connection.post do |req|
    req.url "/search/org/#{org_id}/"
    req.body = words
  end

  list response.body
end

.in_space(space_id, words, attributes = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/podio/models/search.rb', line 38

def in_space(space_id, words, attributes={})
  attributes[:query] = words
  response = Podio.connection.post do |req|
    req.url "/search/space/#{space_id}/"
    req.body = attributes
  end

  list response.body
end

.rank(search_id, rank) ⇒ Object



58
59
60
# File 'lib/podio/models/search.rb', line 58

def rank(search_id, rank)
  Podio.connection.post("/search/#{search_id}/#{rank}/clicked").status
end