Class: EmailDirect::RelaySend::Category
- Inherits:
-
Object
- Object
- EmailDirect::RelaySend::Category
- Defined in:
- lib/emaildirect/relay_send/category.rb
Overview
Represents a relay send category and associated functionality
Instance Attribute Summary collapse
-
#category_id ⇒ Object
readonly
Returns the value of attribute category_id.
Class Method Summary collapse
Instance Method Summary collapse
- #delete ⇒ Object
- #details ⇒ Object
-
#initialize(category_id) ⇒ Category
constructor
A new instance of Category.
- #update(category_name) ⇒ Object
Constructor Details
#initialize(category_id) ⇒ Category
Returns a new instance of Category.
21 22 23 |
# File 'lib/emaildirect/relay_send/category.rb', line 21 def initialize(category_id) @category_id = category_id end |
Instance Attribute Details
#category_id ⇒ Object (readonly)
Returns the value of attribute category_id.
19 20 21 |
# File 'lib/emaildirect/relay_send/category.rb', line 19 def category_id @category_id end |
Class Method Details
.all ⇒ Object
8 9 10 11 |
# File 'lib/emaildirect/relay_send/category.rb', line 8 def all response = EmailDirect.get '/RelaySends' Hashie::Mash.new(response) end |
.create(category_name) ⇒ Object
13 14 15 16 |
# File 'lib/emaildirect/relay_send/category.rb', line 13 def create(category_name) response = EmailDirect.post '/RelaySends', :body => category_name.to_json Hashie::Mash.new(response) end |
Instance Method Details
#delete ⇒ Object
35 36 37 38 |
# File 'lib/emaildirect/relay_send/category.rb', line 35 def delete response = EmailDirect.delete uri_for, {} Hashie::Mash.new(response) end |
#details ⇒ Object
25 26 27 28 |
# File 'lib/emaildirect/relay_send/category.rb', line 25 def details response = get Hashie::Mash.new(response) end |
#update(category_name) ⇒ Object
30 31 32 33 |
# File 'lib/emaildirect/relay_send/category.rb', line 30 def update(category_name) response = EmailDirect.put uri_for, :body => category_name.to_json Hashie::Mash.new(response) end |