class Attune::Model::BlacklistParams

@attr [Array<Attune::Model::ScopeEntry>] scope @attr [String] active_from @attr [String] active_to @attr [String] entity_type @attr [Array<String>] ids @attr [Boolean] disabled

Constants

ATTRIBUTE_MAP

:internal => :external

Attributes

active_from[RW]
active_to[RW]
disabled[RW]
entity_type[RW]
ids[RW]
scope[RW]

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/attune/models/blacklist_params.rb, line 30
def initialize(attributes = {})
  return if attributes.empty?
  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"]
  # 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
  # Workaround since JSON.parse has accessors as strings rather than symbols
  @disabled = attributes["disabled"] || attributes[:"disabled"]
  

end

Public Instance Methods

to_body() click to toggle source
# 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 = {}) click to toggle source
# File lib/attune/models/blacklist_params.rb, line 61
def to_json(options = {})
  to_body.to_json
end