Class: Mandrill::Metadata
- Inherits:
-
Object
- Object
- Mandrill::Metadata
- Defined in:
- lib/mandrill/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#add(name, view_template = nil) ⇒ Hash
Add a new custom metadata field to be indexed for the account.
-
#delete(name) ⇒ Hash
Delete an existing custom metadata field.
-
#initialize(master) ⇒ Metadata
constructor
A new instance of Metadata.
-
#list ⇒ Array
Get the list of custom metadata fields indexed for the account.
-
#update(name, view_template) ⇒ Hash
Update an existing custom metadata field.
Constructor Details
#initialize(master) ⇒ Metadata
Returns a new instance of Metadata.
2003 2004 2005 |
# File 'lib/mandrill/api.rb', line 2003 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
2001 2002 2003 |
# File 'lib/mandrill/api.rb', line 2001 def master @master end |
Instance Method Details
#add(name, view_template = nil) ⇒ Hash
Add a new custom metadata field to be indexed for the account.
2025 2026 2027 2028 |
# File 'lib/mandrill/api.rb', line 2025 def add(name, view_template=nil) _params = {:name => name, :view_template => view_template} return @master.call 'metadata/add', _params end |
#delete(name) ⇒ Hash
Delete an existing custom metadata field. Deletion isn’t instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
2048 2049 2050 2051 |
# File 'lib/mandrill/api.rb', line 2048 def delete(name) _params = {:name => name} return @master.call 'metadata/delete', _params end |
#list ⇒ Array
Get the list of custom metadata fields indexed for the account.
2013 2014 2015 2016 |
# File 'lib/mandrill/api.rb', line 2013 def list() _params = {} return @master.call 'metadata/list', _params end |
#update(name, view_template) ⇒ Hash
Update an existing custom metadata field.
2037 2038 2039 2040 |
# File 'lib/mandrill/api.rb', line 2037 def update(name, view_template) _params = {:name => name, :view_template => view_template} return @master.call 'metadata/update', _params end |