Class: MailUp::Console::Recipient
- Inherits:
-
Object
- Object
- MailUp::Console::Recipient
- Defined in:
- lib/mailup/console/recipient.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#fields ⇒ JSON
Retrieve recipient dynamic field definitions.
-
#initialize(api) ⇒ Recipient
constructor
A new instance of Recipient.
-
#update(recipient) ⇒ JSON
Update a recipient with the specified details into address book.
Constructor Details
#initialize(api) ⇒ Recipient
Returns a new instance of Recipient.
6 7 8 |
# File 'lib/mailup/console/recipient.rb', line 6 def initialize(api) @api = api end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/mailup/console/recipient.rb', line 4 def api @api end |
Instance Method Details
#fields ⇒ JSON
Retrieve recipient dynamic field definitions.
63 64 65 |
# File 'lib/mailup/console/recipient.rb', line 63 def fields @api.get("#{@api.path}/Recipient/DynamicFields") end |
#update(recipient) ⇒ JSON
Update a recipient with the specified details into address book.
39 40 41 |
# File 'lib/mailup/console/recipient.rb', line 39 def update(recipient) @api.put("#{@api.path}/Recipient/Detail", body: recipient) end |