Class: Iterable::ApiResource
- Inherits:
-
Object
- Object
- Iterable::ApiResource
- Defined in:
- lib/iterable/api_resource.rb
Overview
ApiResource is a parent class for rest resources for the Iterable API. It allows for request conifugration to be set per request if needed, otherwise the default global Iterable.config is used
Direct Known Subclasses
Campaigns, Channels, Commerce, Device, Email, EmailTemplates, Events, Experiments, Export, Lists, MessageTypes, Metadata, MetadataTable, PushTemplates, Templates, Users, Workflows
Instance Attribute Summary collapse
-
#conf ⇒ Object
readonly
Returns the value of attribute conf.
Class Method Summary collapse
-
.default_config ⇒ Iterable::Config
Global Iterable config accessor for class.
Instance Method Summary collapse
-
#default_config ⇒ Iterable::Config
Global Iterable config accessor for instance.
-
#initialize(conf = nil) ⇒ Iterable::ApiResource
constructor
Initialize a new ApiResource with an optional config.
Constructor Details
#initialize(conf = nil) ⇒ Iterable::ApiResource
Initialize a new ApiResource with an optional config. Will default to the global [Iterable::Config] via ‘Iterable.config`
17 18 19 |
# File 'lib/iterable/api_resource.rb', line 17 def initialize(conf = nil) @conf = conf ? conf : default_config end |
Instance Attribute Details
#conf ⇒ Object (readonly)
Returns the value of attribute conf.
9 10 11 |
# File 'lib/iterable/api_resource.rb', line 9 def conf @conf end |
Class Method Details
.default_config ⇒ Iterable::Config
Global Iterable config accessor for class
26 27 28 |
# File 'lib/iterable/api_resource.rb', line 26 def self.default_config Iterable.config end |
Instance Method Details
#default_config ⇒ Iterable::Config
Global Iterable config accessor for instance
35 36 37 |
# File 'lib/iterable/api_resource.rb', line 35 def default_config self.class.default_config end |