Class: ScoutScout
- Inherits:
-
Object
- Object
- ScoutScout
- Includes:
- HTTParty
- Defined in:
- lib/scout_scout.rb,
lib/scout_scout/version.rb
Defined Under Namespace
Classes: Alert, Client, Descriptor, Plugin
Constant Summary collapse
- VERSION =
'0.0.3'
Instance Method Summary collapse
-
#alerts ⇒ Array
Recent alerts across all clients on this account.
-
#clients ⇒ Array
All clients on this account.
-
#initialize(scout_account_name, username, password) ⇒ ScoutScout
constructor
A new instance of ScoutScout.
Constructor Details
#initialize(scout_account_name, username, password) ⇒ ScoutScout
Returns a new instance of ScoutScout.
15 16 17 18 |
# File 'lib/scout_scout.rb', line 15 def initialize(scout_account_name, username, password) self.class.account = scout_account_name self.class.basic_auth username, password end |
Instance Method Details
#alerts ⇒ Array
Recent alerts across all clients on this account
23 24 25 26 |
# File 'lib/scout_scout.rb', line 23 def alerts response = self.class.get("/#{self.class.account}/activities.xml") response['alerts'].map { |alert| ScoutScout::Alert.new(alert) } end |
#clients ⇒ Array
All clients on this account
31 32 33 34 |
# File 'lib/scout_scout.rb', line 31 def clients response = self.class.get("/#{self.class.account}/clients.xml") response['clients'].map { |client| ScoutScout::Client.new(client) } end |