Class: MailchimpAPI::CollectionParsers::Base
- Inherits:
-
ActiveResource::Collection
- Object
- ActiveResource::Collection
- MailchimpAPI::CollectionParsers::Base
- Defined in:
- lib/mailchimp_api/collection_parsers/base.rb
Direct Known Subclasses
Campaign, Interest, InterestCategory, Link, List, Member, MergeField, Note, Segment, SegmentMember, SignupForm, TemplateFolder
Instance Attribute Summary collapse
-
#links ⇒ Object
Returns the value of attribute links.
-
#total_items ⇒ Object
Returns the value of attribute total_items.
Instance Method Summary collapse
-
#initialize(response = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(response = {}) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 |
# File 'lib/mailchimp_api/collection_parsers/base.rb', line 7 def initialize(response = {}) @links = instantiate_links response.delete '_links' @total_items = response.delete 'total_items' @elements = response[element_key] || [] end |
Instance Attribute Details
#links ⇒ Object
Returns the value of attribute links.
5 6 7 |
# File 'lib/mailchimp_api/collection_parsers/base.rb', line 5 def links @links end |
#total_items ⇒ Object
Returns the value of attribute total_items.
5 6 7 |
# File 'lib/mailchimp_api/collection_parsers/base.rb', line 5 def total_items @total_items end |