Class: EmailDirect::Creative
- Inherits:
-
Object
- Object
- EmailDirect::Creative
- Defined in:
- lib/emaildirect/creative.rb
Overview
Represents a creative and associated functionality
Instance Attribute Summary collapse
-
#creative_id ⇒ Object
readonly
Returns the value of attribute creative_id.
Class Method Summary collapse
Instance Method Summary collapse
- #delete ⇒ Object
- #details ⇒ Object
-
#initialize(creative_id) ⇒ Creative
constructor
A new instance of Creative.
- #update(name, options) ⇒ Object
Constructor Details
#initialize(creative_id) ⇒ Creative
Returns a new instance of Creative.
22 23 24 |
# File 'lib/emaildirect/creative.rb', line 22 def initialize(creative_id) @creative_id = creative_id end |
Instance Attribute Details
#creative_id ⇒ Object (readonly)
Returns the value of attribute creative_id.
20 21 22 |
# File 'lib/emaildirect/creative.rb', line 20 def creative_id @creative_id end |
Class Method Details
.all(options = {}) ⇒ Object
8 9 10 11 |
# File 'lib/emaildirect/creative.rb', line 8 def all( = {}) response = EmailDirect.get '/Creatives', :query => Hashie::Mash.new(response) end |
.create(name, options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/emaildirect/creative.rb', line 13 def create(name, = {}) .merge! :Name => name response = EmailDirect.post '/Creatives', :body => .to_json Hashie::Mash.new(response) end |
Instance Method Details
#delete ⇒ Object
37 38 39 40 |
# File 'lib/emaildirect/creative.rb', line 37 def delete response = EmailDirect.delete uri_for, {} Hashie::Mash.new(response) end |
#details ⇒ Object
26 27 28 29 |
# File 'lib/emaildirect/creative.rb', line 26 def details response = get Hashie::Mash.new(response) end |
#update(name, options) ⇒ Object
31 32 33 34 35 |
# File 'lib/emaildirect/creative.rb', line 31 def update(name, ) .merge! :Name => name response = EmailDirect.put uri_for, :body => .to_json Hashie::Mash.new(response) end |