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, #initialize_attributes, list, member, #new_record?, output_attribute_as_json, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

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



25
26
27
28
29
30
31
32
33
# File 'lib/podio/models/search.rb', line 25

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



45
46
47
48
49
50
51
52
53
# File 'lib/podio/models/search.rb', line 45

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



16
17
18
19
20
21
22
23
# File 'lib/podio/models/search.rb', line 16

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



35
36
37
38
39
40
41
42
43
# File 'lib/podio/models/search.rb', line 35

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



55
56
57
# File 'lib/podio/models/search.rb', line 55

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