Class: Attune::Model::BlacklistParams
- Inherits:
-
Object
- Object
- Attune::Model::BlacklistParams
- Defined in:
- lib/attune/models/blacklist_params.rb
Instance Attribute Summary collapse
-
#active_from ⇒ String
The current value of active_from.
-
#active_to ⇒ String
The current value of active_to.
-
#disabled ⇒ Boolean
The current value of disabled.
-
#entity_type ⇒ String
The current value of entity_type.
-
#ids ⇒ Array<String>
The current value of ids.
-
#scope ⇒ Array<Attune::Model::ScopeEntry>
The current value of scope.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BlacklistParams
constructor
A new instance of BlacklistParams.
- #to_body ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ BlacklistParams
Returns a new instance of BlacklistParams.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/attune/models/blacklist_params.rb', line 30 def initialize(attributes = {}) return if attributes.empty? # 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 @entity_type = attributes["entityType"] || attributes[:"entity_type"] value = attributes["ids"] || attributes[:"ids"] if value.is_a?(Array) @ids = value end value = attributes["scope"] || attributes[:"scope"] if value.is_a?(Array) @scope = value.map{ |v| ScopeEntry.new(v) } end # Workaround since JSON.parse has accessors as strings rather than symbols @active_from = attributes["activeFrom"] || attributes[:"active_from"] # Workaround since JSON.parse has accessors as strings rather than symbols @active_to = attributes["activeTo"] || attributes[:"active_to"] end |
Instance Attribute Details
#active_from ⇒ String
Returns the current value of active_from.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def active_from @active_from end |
#active_to ⇒ String
Returns the current value of active_to.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def active_to @active_to end |
#disabled ⇒ Boolean
Returns the current value of disabled.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def disabled @disabled end |
#entity_type ⇒ String
Returns the current value of entity_type.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def entity_type @entity_type end |
#ids ⇒ Array<String>
Returns the current value of ids.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def ids @ids end |
#scope ⇒ Array<Attune::Model::ScopeEntry>
Returns the current value of scope.
11 12 13 |
# File 'lib/attune/models/blacklist_params.rb', line 11 def scope @scope end |
Instance Method Details
#to_body ⇒ Object
54 55 56 57 58 59 |
# File 'lib/attune/models/blacklist_params.rb', line 54 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end |
#to_json(options = {}) ⇒ Object
61 62 63 |
# File 'lib/attune/models/blacklist_params.rb', line 61 def to_json( = {}) to_body.to_json end |