Method: VoucherifySdk::ValidationRulesListResponseBody#initialize

Defined in:
lib/VoucherifySdk/models/validation_rules_list_response_body.rb

#initialize(attributes = {}) ⇒ ValidationRulesListResponseBody

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/VoucherifySdk/models/validation_rules_list_response_body.rb', line 68

def initialize(attributes = {})
  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    h[k.to_sym] = v
  }

  if attributes.key?(:'object')
    self.object = attributes[:'object']
  else
    self.object = 'list'
  end

  if attributes.key?(:'data_ref')
    self.data_ref = attributes[:'data_ref']
  else
    self.data_ref = 'data'
  end

  if attributes.key?(:'data')
    if (value = attributes[:'data']).is_a?(Array)
      self.data = value
    end
  end

  if attributes.key?(:'total')
    self.total = attributes[:'total']
  end
end