Class: Attune::Model::Blacklist

Inherits:
Object
  • Object
show all
Defined in:
lib/attune/models/blacklist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#consumerString

Returns the current value of consumer.

Returns:

  • (String)

    the current value of consumer



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def consumer
  @consumer
end

#created_dateString

Returns the current value of created_date.

Returns:

  • (String)

    the current value of created_date



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def created_date
  @created_date
end

#disabledBoolean

Returns the current value of disabled.

Returns:

  • (Boolean)

    the current value of disabled



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def disabled
  @disabled
end

#end_dateString

Returns the current value of end_date.

Returns:

  • (String)

    the current value of end_date



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def end_date
  @end_date
end

#entity_typeString

Returns the current value of entity_type.

Returns:

  • (String)

    the current value of entity_type



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def entity_type
  @entity_type
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def id
  @id
end

#idsArray<String>

Returns the current value of ids.

Returns:

  • (Array<String>)

    the current value of ids



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def ids
  @ids
end

#scopeString

Returns the current value of scope.

Returns:

  • (String)

    the current value of scope



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def scope
  @scope
end

#start_dateString

Returns the current value of start_date.

Returns:

  • (String)

    the current value of start_date



15
16
17
# File 'lib/attune/models/blacklist.rb', line 15

def start_date
  @start_date
end

#updated_dateString

Returns the current value of updated_date.

Returns:

  • (String)

    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_bodyObject



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(options = {})
  to_body.to_json
end