Class: Beeper::Client
- Inherits:
-
Object
- Object
- Beeper::Client
- Defined in:
- lib/beeper/client.rb
Constant Summary collapse
- COLLECTIONS =
[:incidents, :services, :maintenance_windows].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#requester_id ⇒ Object
Returns the value of attribute requester_id.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
Instance Method Summary collapse
- #configured? ⇒ Boolean
- #create_maintenance_window(maintenance_window) ⇒ Object
- #delete_maintenance_window(id) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/beeper/client.rb', line 10 def initialize @use_ssl = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/beeper/client.rb', line 8 def api_key @api_key end |
#requester_id ⇒ Object
Returns the value of attribute requester_id.
8 9 10 |
# File 'lib/beeper/client.rb', line 8 def requester_id @requester_id end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
8 9 10 |
# File 'lib/beeper/client.rb', line 8 def subdomain @subdomain end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
8 9 10 |
# File 'lib/beeper/client.rb', line 8 def use_ssl @use_ssl end |
Instance Method Details
#configured? ⇒ Boolean
14 15 16 |
# File 'lib/beeper/client.rb', line 14 def configured? !@api_key.nil? && !@subdomain.nil? end |
#create_maintenance_window(maintenance_window) ⇒ Object
26 27 28 |
# File 'lib/beeper/client.rb', line 26 def create_maintenance_window(maintenance_window) post(:maintenance_windows, maintenance_window) end |
#delete_maintenance_window(id) ⇒ Object
30 31 32 |
# File 'lib/beeper/client.rb', line 30 def delete_maintenance_window(id) delete(:maintenance_windows, { :id => id }) end |