Class: Pushover::Client
- Inherits:
-
Object
- Object
- Pushover::Client
- Defined in:
- lib/pushover/client.rb
Overview
Client holds shared application credentials and exposes API resources.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #glances ⇒ Object
- #groups ⇒ Object
-
#initialize(token:, connection: Pushover::Excon) ⇒ Client
constructor
A new instance of Client.
- #licenses ⇒ Object
- #limits ⇒ Object
- #messages ⇒ Object
- #receipts ⇒ Object
- #sounds ⇒ Object
- #subscriptions ⇒ Object
- #teams ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(token:, connection: Pushover::Excon) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 |
# File 'lib/pushover/client.rb', line 6 def initialize(token:, connection: Pushover::Excon) raise ArgumentError, 'token must be supplied' unless token.is_a?(String) && !token.empty? @token = token @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/pushover/client.rb', line 4 def connection @connection end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/pushover/client.rb', line 4 def token @token end |
Instance Method Details
#glances ⇒ Object
33 34 35 |
# File 'lib/pushover/client.rb', line 33 def glances @glances ||= Glances.new(self) end |
#groups ⇒ Object
37 38 39 |
# File 'lib/pushover/client.rb', line 37 def groups @groups ||= Groups.new(self) end |
#licenses ⇒ Object
45 46 47 |
# File 'lib/pushover/client.rb', line 45 def licenses @licenses ||= Licenses.new(self) end |
#limits ⇒ Object
29 30 31 |
# File 'lib/pushover/client.rb', line 29 def limits @limits ||= Limits.new(self) end |
#messages ⇒ Object
13 14 15 |
# File 'lib/pushover/client.rb', line 13 def @messages ||= Messages.new(self) end |
#receipts ⇒ Object
17 18 19 |
# File 'lib/pushover/client.rb', line 17 def receipts @receipts ||= Receipts.new(self) end |
#sounds ⇒ Object
25 26 27 |
# File 'lib/pushover/client.rb', line 25 def sounds @sounds ||= Sounds.new(self) end |
#subscriptions ⇒ Object
41 42 43 |
# File 'lib/pushover/client.rb', line 41 def subscriptions @subscriptions ||= Subscriptions.new(self) end |