class Mailflow::Attribute
Attributes
key[RW]
label[RW]
value[RW]
Public Class Methods
delete(attributes, params = {})
click to toggle source
# File lib/mailflow-ruby/attribute.rb, line 28 def delete(attributes, params = {}) body = {attributes: attributes}.merge(params) response = delete_request('attributes', body) raise UnprocessableError if (response.code == 422 || response.code == 404) return true end
list(options = {})
click to toggle source
# File lib/mailflow-ruby/attribute.rb, line 12 def list(options = {}) response = get_request('attributes', options) response.parsed_response.map do |params| Attribute.new(params) end end
new(attributes)
click to toggle source
# File lib/mailflow-ruby/attribute.rb, line 37 def initialize(attributes) @key = attributes["key"] @label = attributes["label"] @value = attributes["value"] end
update(attributes, params)
click to toggle source
# File lib/mailflow-ruby/attribute.rb, line 19 def update(attributes, params) body = {attributes: attributes}.merge(params) response = post_request('attributes', body) raise UnprocessableError if (response.code == 422 || response.code == 404) response.parsed_response.map do |attributes| Attribute.new(attributes) end end
Public Instance Methods
==(other)
click to toggle source
# File lib/mailflow-ruby/attribute.rb, line 43 def ==(other) self.name == other.name end