lib/attune/models/blacklist.rb in attune-1.0.14 vs lib/attune/models/blacklist.rb in attune-1.0.15

- old
+ new

@@ -1,33 +1,30 @@ module Attune module Model # # # @attr [String] id - # @attr [Boolean] disabled - # @attr [String] entity_type - # @attr [String] start_date # @attr [String] end_date + # @attr [String] start_date + # @attr [String] entity_type # @attr [String] consumer # @attr [Array<String>] ids # @attr [String] created_date # @attr [String] updated_date # @attr [String] scope + # @attr [Boolean] disabled class Blacklist attr_accessor :id - attr_accessor :disabled + attr_accessor :end_date - attr_accessor :entity_type - - attr_accessor :start_date - attr_accessor :end_date + attr_accessor :entity_type attr_accessor :consumer @@ -41,22 +38,23 @@ attr_accessor :scope + attr_accessor :disabled + + def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @id = attributes["id"] || attributes[:"id"] # Workaround since JSON.parse has accessors as strings rather than symbols - @disabled = attributes["disabled"] || attributes[:"disabled"] + @end_date = attributes["endDate"] || attributes[:"end_date"] # 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"] + @entity_type = attributes["entityType"] || attributes[:"entity_type"] # Workaround since JSON.parse has accessors as strings rather than symbols @consumer = attributes["consumer"] || attributes[:"consumer"] value = attributes["ids"] || attributes[:"ids"] if value.is_a?(Array) @ids = value @@ -66,10 +64,12 @@ @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"] # 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"] end def to_body @@ -85,18 +85,18 @@ private # :internal => :external ATTRIBUTE_MAP = { :id => :id, - :disabled => :disabled, - :entity_type => :entityType, - :start_date => :startDate, :end_date => :endDate, + :start_date => :startDate, + :entity_type => :entityType, :consumer => :consumer, :ids => :ids, :created_date => :createdDate, :updated_date => :updatedDate, - :scope => :scope + :scope => :scope, + :disabled => :disabled } end end end