Class: Iterable::Catalogs

Inherits:
ApiResource show all
Defined in:
lib/iterable/catalogs.rb

Overview

Interact with /catalogs/catalogName API endpoints **currently in Beta only**

Examples:

Creating catalog endpoint object

# With default config
catalog = Iterable::Catalogs.new "catalog-name"
catalog.items

# With custom config
conf = Iterable::Config.new(token: 'new-token')
catalog = Iterable::Catalogs.new("catalog-name", config)

Instance Attribute Summary collapse

Attributes inherited from ApiResource

#conf

Instance Method Summary collapse

Methods inherited from ApiResource

default_config, #default_config

Constructor Details

#initialize(name, conf = nil) ⇒ Catalogs

Returns a new instance of Catalogs.



29
30
31
32
# File 'lib/iterable/catalogs.rb', line 29

def initialize(name, conf = nil)
  @name = name
  super conf
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/iterable/catalogs.rb', line 18

def name
  @name
end

Instance Method Details

#createObject



40
41
42
# File 'lib/iterable/catalogs.rb', line 40

def create
  Iterable.request(conf, base_path).post
end

#deleteObject



50
51
52
# File 'lib/iterable/catalogs.rb', line 50

def delete
  Iterable.request(conf, base_path).delete
end

#names(params = {}) ⇒ Object



60
61
62
# File 'lib/iterable/catalogs.rb', line 60

def names(params = {})
  Iterable.request(conf, '/catalogs', params).get
end