Class: Attune::Model::Blacklist
- Inherits:
-
Object
- Object
- Attune::Model::Blacklist
- Defined in:
- lib/attune/models/blacklist.rb
Instance Attribute Summary collapse
-
#consumer ⇒ String
The current value of consumer.
-
#created_date ⇒ String
The current value of created_date.
-
#disabled ⇒ Boolean
The current value of disabled.
-
#end_date ⇒ String
The current value of end_date.
-
#entity_type ⇒ String
The current value of entity_type.
-
#id ⇒ String
The current value of id.
-
#ids ⇒ Array<String>
The current value of ids.
-
#scope ⇒ String
The current value of scope.
-
#start_date ⇒ String
The current value of start_date.
-
#updated_date ⇒ String
The current value of updated_date.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Blacklist
constructor
A new instance of Blacklist.
- #to_body ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Blacklist
Returns a new instance of Blacklist.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/attune/models/blacklist.rb', line 46 def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @id = attributes["id"] || attributes[:"id"] value = attributes["ids"] || attributes[:"ids"] if value.is_a?(Array) @ids = value end # Workaround since JSON.parse has accessors as strings rather than symbols @consumer = attributes["consumer"] || attributes[:"consumer"] # Workaround since JSON.parse has accessors as strings rather than symbols @entity_type = attributes["entityType"] || attributes[:"entity_type"] # Workaround since JSON.parse has accessors as strings rather than symbols @start_date = attributes["startDate"] || attributes[:"start_date"] # Workaround since JSON.parse has accessors as strings rather than symbols @end_date = attributes["endDate"] || attributes[:"end_date"] # Workaround since JSON.parse has accessors as strings rather than symbols @scope = attributes["scope"] || attributes[:"scope"] # Workaround since JSON.parse has accessors as strings rather than symbols @disabled = attributes["disabled"] || attributes[:"disabled"] # Workaround since JSON.parse has accessors as strings rather than symbols @created_date = attributes["createdDate"] || attributes[:"created_date"] # Workaround since JSON.parse has accessors as strings rather than symbols @updated_date = attributes["updatedDate"] || attributes[:"updated_date"] end |
Instance Attribute Details
#consumer ⇒ String
Returns the current value of consumer.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def consumer @consumer end |
#created_date ⇒ String
Returns the current value of created_date.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def created_date @created_date end |
#disabled ⇒ Boolean
Returns the current value of disabled.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def disabled @disabled end |
#end_date ⇒ String
Returns the current value of end_date.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def end_date @end_date end |
#entity_type ⇒ String
Returns the current value of entity_type.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def entity_type @entity_type end |
#id ⇒ String
Returns the current value of id.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def id @id end |
#ids ⇒ Array<String>
Returns the current value of ids.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def ids @ids end |
#scope ⇒ String
Returns the current value of scope.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def scope @scope end |
#start_date ⇒ String
Returns the current value of start_date.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def start_date @start_date end |
#updated_date ⇒ String
Returns the current value of updated_date.
15 16 17 |
# File 'lib/attune/models/blacklist.rb', line 15 def updated_date @updated_date end |
Instance Method Details
#to_body ⇒ Object
75 76 77 78 79 80 |
# File 'lib/attune/models/blacklist.rb', line 75 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end |
#to_json(options = {}) ⇒ Object
82 83 84 |
# File 'lib/attune/models/blacklist.rb', line 82 def to_json( = {}) to_body.to_json end |