Class: ET::List
- Inherits:
-
CUDSupport
- Object
- BaseObject
- GetSupport
- CUDSupport
- ET::List
- Defined in:
- lib/exact-target-api/list.rb,
lib/exact-target-api/list_subscriber.rb
Defined Under Namespace
Classes: Subscriber
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#list_id ⇒ Object
readonly
Returns the value of attribute list_id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from GetSupport
Attributes inherited from BaseObject
#client, #endpoint, #lastRequestID, #obj, #props
Instance Method Summary collapse
-
#create(params) ⇒ Object
Example: “NewListName”, Description: “This list was created with the RubySDK”, Type: “Private”.
- #destroy(id) ⇒ Object
- #find(id) ⇒ Object
- #id ⇒ Object
-
#initialize(client) ⇒ List
constructor
A new instance of List.
- #subscriber ⇒ Object
- #update(params) ⇒ Object
Methods inherited from CUDSupport
Methods inherited from GetSupport
Methods inherited from BaseObject
#stringify_keys!, #symbolize_keys!
Constructor Details
#initialize(client) ⇒ List
Returns a new instance of List.
5 6 7 8 9 |
# File 'lib/exact-target-api/list.rb', line 5 def initialize(client) super() @obj = 'List' @client = client end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/exact-target-api/list.rb', line 3 def code @code end |
#list_id ⇒ Object (readonly)
Returns the value of attribute list_id.
3 4 5 |
# File 'lib/exact-target-api/list.rb', line 3 def list_id @list_id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/exact-target-api/list.rb', line 3 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/exact-target-api/list.rb', line 3 def status @status end |
Instance Method Details
#create(params) ⇒ Object
Example: “NewListName”, Description: “This list was created with the RubySDK”, Type: “Private”
17 18 19 20 21 22 |
# File 'lib/exact-target-api/list.rb', line 17 def create(params) stringify_keys!(params) res = post(params) assign_values(res) self end |
#destroy(id) ⇒ Object
47 48 49 |
# File 'lib/exact-target-api/list.rb', line 47 def destroy(id) delete('ID' => id.to_s) end |
#find(id) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/exact-target-api/list.rb', line 37 def find(id) props = ["ID", "PartnerKey", "CreatedDate", "ModifiedDate", "Client.ID", "Client.PartnerClientKey", "ListName", "Description", "Category", "Type", "CustomerKey", "ListClassification", "AutomatedEmail.ID"] filter = {'Property' => 'ID', 'SimpleOperator' => 'equals', 'Value' => id.to_s} res = get(props, filter) assign_values(res) self end |
#id ⇒ Object
11 12 13 |
# File 'lib/exact-target-api/list.rb', line 11 def id @list_id end |
#subscriber ⇒ Object
51 52 53 |
# File 'lib/exact-target-api/list.rb', line 51 def subscriber ET::Subscriber.new(@client, @list_id) end |
#update(params) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/exact-target-api/list.rb', line 24 def update(params) stringify_keys!(params) data = params.merge('ID' => @list_id) res = patch(data) puts "[DEBUG] List update: #{res.inspect}" raise('implement me') self end |