Class: Gauges
- Inherits:
-
Object
- Object
- Gauges
- Includes:
- HTTParty
- Defined in:
- lib/gauges.rb,
lib/gauges/version.rb
Constant Summary collapse
- VERSION =
'0.2.1'
Instance Method Summary collapse
- #clients ⇒ Object
- #content(id, params = {}) ⇒ Object
-
#create_client(params = {}) ⇒ Object
:description => Any text describing what this client is or will be used for (ie: Campfire, GitHub, HipChat…).
-
#create_gauge(params = {}) ⇒ Object
:title => The title of the gauge (ie: RailsTips) :tz => The time zone stats should be tracked in.
- #delete_client(id) ⇒ Object
- #delete_gauge(id) ⇒ Object
- #engines(id, params = {}) ⇒ Object
- #gauge(id) ⇒ Object
- #gauges ⇒ Object
-
#initialize(options = {}) ⇒ Gauges
constructor
:token => get.gaug.es/documentation/api/authentication/.
- #locations(id, params = {}) ⇒ Object
- #me ⇒ Object
- #referrers(id, params = {}) ⇒ Object
- #resolutions(id, params = {}) ⇒ Object
-
#share(id, params = {}) ⇒ Object
:email => The email of the user to add.
- #shares(id) ⇒ Object
- #technology(id, params = {}) ⇒ Object
- #terms(id, params = {}) ⇒ Object
- #token ⇒ Object
- #traffic(id, params = {}) ⇒ Object
- #unshare(id, user_id) ⇒ Object
- #update_gauge(id, params = {}) ⇒ Object
-
#update_me(params = {}) ⇒ Object
:first_name, :last_name.
- #url(url) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Gauges
:token => get.gaug.es/documentation/api/authentication/
9 10 11 |
# File 'lib/gauges.rb', line 9 def initialize(={}) @options = end |
Instance Method Details
#clients ⇒ Object
22 23 24 |
# File 'lib/gauges.rb', line 22 def clients get('/clients') end |
#content(id, params = {}) ⇒ Object
70 71 72 |
# File 'lib/gauges.rb', line 70 def content(id, params={}) get("/gauges/#{id}/content", params) end |
#create_client(params = {}) ⇒ Object
:description => Any text describing what this client is or will be used for (ie: Campfire, GitHub, HipChat…)
27 28 29 |
# File 'lib/gauges.rb', line 27 def create_client(params={}) post('/clients', params) end |
#create_gauge(params = {}) ⇒ Object
:title => The title of the gauge (ie: RailsTips) :tz => The time zone stats should be tracked in
41 42 43 |
# File 'lib/gauges.rb', line 41 def create_gauge(params={}) post('/gauges', params) end |
#delete_client(id) ⇒ Object
31 32 33 |
# File 'lib/gauges.rb', line 31 def delete_client(id) delete("/clients/#{id}") end |
#delete_gauge(id) ⇒ Object
53 54 55 |
# File 'lib/gauges.rb', line 53 def delete_gauge(id) delete("/gauges/#{id}") end |
#engines(id, params = {}) ⇒ Object
94 95 96 |
# File 'lib/gauges.rb', line 94 def engines(id, params={}) get("/gauges/#{id}/engines", params) end |
#gauge(id) ⇒ Object
45 46 47 |
# File 'lib/gauges.rb', line 45 def gauge(id) get("/gauges/#{id}") end |
#gauges ⇒ Object
35 36 37 |
# File 'lib/gauges.rb', line 35 def gauges get('/gauges') end |
#locations(id, params = {}) ⇒ Object
98 99 100 |
# File 'lib/gauges.rb', line 98 def locations(id, params={}) get("/gauges/#{id}/locations", params) end |
#me ⇒ Object
13 14 15 |
# File 'lib/gauges.rb', line 13 def me get('/me') end |
#referrers(id, params = {}) ⇒ Object
74 75 76 |
# File 'lib/gauges.rb', line 74 def referrers(id, params={}) get("/gauges/#{id}/referrers", params) end |
#resolutions(id, params = {}) ⇒ Object
82 83 84 |
# File 'lib/gauges.rb', line 82 def resolutions(id, params={}) get("/gauges/#{id}/resolutions", params) end |
#share(id, params = {}) ⇒ Object
:email => The email of the user to add
62 63 64 |
# File 'lib/gauges.rb', line 62 def share(id, params={}) post("/gauges/#{id}/shares", params) end |
#shares(id) ⇒ Object
57 58 59 |
# File 'lib/gauges.rb', line 57 def shares(id) get("/gauges/#{id}/shares") end |
#technology(id, params = {}) ⇒ Object
86 87 88 |
# File 'lib/gauges.rb', line 86 def technology(id, params={}) get("/gauges/#{id}/technology", params) end |
#terms(id, params = {}) ⇒ Object
90 91 92 |
# File 'lib/gauges.rb', line 90 def terms(id, params={}) get("/gauges/#{id}/terms", params) end |
#token ⇒ Object
102 103 104 |
# File 'lib/gauges.rb', line 102 def token @options[:token] end |
#traffic(id, params = {}) ⇒ Object
78 79 80 |
# File 'lib/gauges.rb', line 78 def traffic(id, params={}) get("/gauges/#{id}/traffic", params) end |
#unshare(id, user_id) ⇒ Object
66 67 68 |
# File 'lib/gauges.rb', line 66 def unshare(id, user_id) delete("/gauges/#{id}/shares/#{user_id}") end |
#update_gauge(id, params = {}) ⇒ Object
49 50 51 |
# File 'lib/gauges.rb', line 49 def update_gauge(id, params={}) put("/gauges/#{id}", params) end |
#update_me(params = {}) ⇒ Object
:first_name, :last_name
18 19 20 |
# File 'lib/gauges.rb', line 18 def update_me(params={}) put('/me', params) end |
#url(url) ⇒ Object
106 107 108 109 |
# File 'lib/gauges.rb', line 106 def url(url) host, *parts = url.gsub(/https?\:\/\//, '').split('/') get("/#{parts.join('/')}") end |