Module: Hoptoad
- Extended by:
- Hoptoad
- Included in:
- Hoptoad
- Defined in:
- lib/hoptoad-api/client.rb,
lib/hoptoad-api.rb,
lib/hoptoad-api/version.rb
Overview
Ruby lib for working with the Hoptoad API’s XML interface. The first thing you need to set is the account name. This is the same as the web address for your account.
Hoptoad.account = 'myaccount'
Then, you should set the authentication token.
Hoptoad.auth_token = 'abcdefg'
If no token or authentication info is given, a HoptoadError exception will be raised.
If your account uses ssl then turn it on:
Hoptoad.secure = true
For more details, check out the hoptoad docs at hoptoadapp.com/pages/api.
Find errors
Errors are paginated. You get 25 at a time.
errors = Hoptoad::Error.find(:all)
with pagination:
Hoptoad::Error.find(:all, :params => { :page => 2 })
find individual error by ID
Hoptoad::Error.find(44)
Find all notices by error_id
notices = Hoptoad::Notice.all(1234) # 1234 == error id
Find notice by id + error_id
notice = Hoptoad::Notice.find(12345, 1234) # 12345 == notice id, 1234 == error id
Defined Under Namespace
Classes: Base, Error, HoptoadError, Notice
Constant Summary collapse
- VERSION =
'2.2.0'
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#secure ⇒ Object
Returns the value of attribute secure.
Instance Method Summary collapse
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
6 7 8 |
# File 'lib/hoptoad-api.rb', line 6 def account @account end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
6 7 8 |
# File 'lib/hoptoad-api.rb', line 6 def auth_token @auth_token end |
#secure ⇒ Object
Returns the value of attribute secure.
6 7 8 |
# File 'lib/hoptoad-api.rb', line 6 def secure @secure end |
Instance Method Details
#account_path ⇒ Object
16 17 18 |
# File 'lib/hoptoad-api.rb', line 16 def account_path "#{protocol}://#{@account}.hoptoadapp.com" end |
#configure(options = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/hoptoad-api.rb', line 10 def configure(={}) @account = [:account] if .has_key?(:account) @auth_token = [:auth_token] if .has_key?(:auth_token) @secure = [:secure] if .has_key?(:secure) end |
#protocol ⇒ Object
20 21 22 |
# File 'lib/hoptoad-api.rb', line 20 def protocol secure ? "https" : "http" end |