Class: Hubspot::Subscription
- Inherits:
-
Object
- Object
- Hubspot::Subscription
- Defined in:
- lib/hubspot/subscription.rb
Constant Summary collapse
- SUBSCRIPTIONS_PATH =
'/email/public/v1/subscriptions'
- TIMELINE_PATH =
'/email/public/v1/subscriptions/timeline'
- SUBSCRIPTION_PATH =
'/email/public/v1/subscriptions/:email_address'
Instance Attribute Summary collapse
-
#bounced ⇒ Object
readonly
Returns the value of attribute bounced.
-
#marked_as_spam ⇒ Object
readonly
Returns the value of attribute marked_as_spam.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subscribed ⇒ Object
readonly
Returns the value of attribute subscribed.
-
#subscription_statuses ⇒ Object
readonly
Returns the value of attribute subscription_statuses.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ Subscription
constructor
A new instance of Subscription.
Constructor Details
#initialize(response_hash) ⇒ Subscription
Returns a new instance of Subscription.
13 14 15 16 17 18 19 |
# File 'lib/hubspot/subscription.rb', line 13 def initialize(response_hash) @subscribed = response_hash['subscribed'] @marked_as_spam = response_hash['markedAsSpam'] @bounced = response_hash['bounced'] @status = response_hash['status'] @subscription_statuses = response_hash['SubscriptionStatuses'] end |
Instance Attribute Details
#bounced ⇒ Object (readonly)
Returns the value of attribute bounced.
9 10 11 |
# File 'lib/hubspot/subscription.rb', line 9 def bounced @bounced end |
#marked_as_spam ⇒ Object (readonly)
Returns the value of attribute marked_as_spam.
8 9 10 |
# File 'lib/hubspot/subscription.rb', line 8 def marked_as_spam @marked_as_spam end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/hubspot/subscription.rb', line 10 def status @status end |
#subscribed ⇒ Object (readonly)
Returns the value of attribute subscribed.
7 8 9 |
# File 'lib/hubspot/subscription.rb', line 7 def subscribed @subscribed end |
#subscription_statuses ⇒ Object (readonly)
Returns the value of attribute subscription_statuses.
11 12 13 |
# File 'lib/hubspot/subscription.rb', line 11 def subscription_statuses @subscription_statuses end |
Class Method Details
.status(email) ⇒ Object
22 23 24 25 |
# File 'lib/hubspot/subscription.rb', line 22 def status(email) response = Hubspot::Connection.get_json(SUBSCRIPTION_PATH, {email_address: email}) new(response) end |