Class: Iterable::CatalogItems
- Inherits:
-
ApiResource
- Object
- ApiResource
- Iterable::CatalogItems
- Defined in:
- lib/iterable/catalog_items.rb
Overview
Interact with /catalogs/catalogName/itemID API endpoints **currently in Beta only**
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#item_id ⇒ Object
readonly
Returns the value of attribute item_id.
Attributes inherited from ApiResource
Instance Method Summary collapse
- #all(params = {}) ⇒ Object
- #create(item_attrs = {}) ⇒ Object (also: #replace)
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(catalog, item_id = nil, conf = nil) ⇒ CatalogItems
constructor
A new instance of CatalogItems.
- #update(item_attrs = {}) ⇒ Object
Methods inherited from ApiResource
default_config, #default_config
Constructor Details
#initialize(catalog, item_id = nil, conf = nil) ⇒ CatalogItems
Returns a new instance of CatalogItems.
36 37 38 39 40 |
# File 'lib/iterable/catalog_items.rb', line 36 def initialize(catalog, item_id = nil, conf = nil) @catalog = catalog @item_id = item_id super conf end |
Instance Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
18 19 20 |
# File 'lib/iterable/catalog_items.rb', line 18 def catalog @catalog end |
#item_id ⇒ Object (readonly)
Returns the value of attribute item_id.
18 19 20 |
# File 'lib/iterable/catalog_items.rb', line 18 def item_id @item_id end |
Instance Method Details
#all(params = {}) ⇒ Object
50 51 52 |
# File 'lib/iterable/catalog_items.rb', line 50 def all(params = {}) Iterable.request(conf, base_path, params).get end |
#create(item_attrs = {}) ⇒ Object Also known as: replace
62 63 64 65 |
# File 'lib/iterable/catalog_items.rb', line 62 def create(item_attrs = {}) body = { value: item_attrs } Iterable.request(conf, base_path).put(body) end |
#delete ⇒ Object
97 98 99 |
# File 'lib/iterable/catalog_items.rb', line 97 def delete Iterable.request(conf, base_path).delete end |
#get ⇒ Object
87 88 89 |
# File 'lib/iterable/catalog_items.rb', line 87 def get Iterable.request(conf, base_path).get end |
#update(item_attrs = {}) ⇒ Object
76 77 78 79 |
# File 'lib/iterable/catalog_items.rb', line 76 def update(item_attrs = {}) body = { update: item_attrs } Iterable.request(conf, base_path).patch(body) end |