Class: Attune::Model::BlacklistGetResponse
- Inherits:
-
Object
- Object
- Attune::Model::BlacklistGetResponse
- Defined in:
- lib/attune/models/blacklist_get_response.rb
Instance Attribute Summary collapse
-
#blacklists ⇒ Array<Attune::Model::Blacklist>
The current value of blacklists.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BlacklistGetResponse
constructor
A new instance of BlacklistGetResponse.
- #to_body ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ BlacklistGetResponse
Returns a new instance of BlacklistGetResponse.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/attune/models/blacklist_get_response.rb', line 10 def initialize(attributes = {}) return if attributes.empty? value = attributes["blacklists"] || attributes[:"blacklists"] if value.is_a?(Array) @blacklists = value.map{ |v| Blacklist.new(v) } end end |
Instance Attribute Details
#blacklists ⇒ Array<Attune::Model::Blacklist>
Returns the current value of blacklists.
6 7 8 |
# File 'lib/attune/models/blacklist_get_response.rb', line 6 def blacklists @blacklists end |
Instance Method Details
#to_body ⇒ Object
21 22 23 24 25 26 |
# File 'lib/attune/models/blacklist_get_response.rb', line 21 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end |
#to_json(options = {}) ⇒ Object
28 29 30 |
# File 'lib/attune/models/blacklist_get_response.rb', line 28 def to_json( = {}) to_body.to_json end |