Class: Hey::Subscriber
- Inherits:
-
Dispatcher
- Object
- Dispatcher
- Hey::Subscriber
- Defined in:
- lib/hey/subscriber.rb
Overview
Sends requests to the Yo API subscriber endpoint.
Instance Attribute Summary
Attributes inherited from Dispatcher
Class Method Summary collapse
-
.count ⇒ Object
Sends a request to the
subscribers_countendpoint using the API token set on the Hey module.
Instance Method Summary collapse
-
#count ⇒ Object
Sends a request to the
subscribers_countendpoint.
Methods inherited from Dispatcher
Constructor Details
This class inherits a constructor from Hey::Dispatcher
Class Method Details
.count ⇒ Object
Sends a request to the subscribers_count endpoint using the API token set on the Hey module.
17 18 19 |
# File 'lib/hey/subscriber.rb', line 17 def self.count new.count end |
Instance Method Details
#count ⇒ Object
Sends a request to the subscribers_count endpoint. Raises a MissingAPITokenError error if an API token hasn’t been set on the Hey module or Yo instance.
10 11 12 13 |
# File 'lib/hey/subscriber.rb', line 10 def count request = get 'subscribers_count' request.json['count'] end |