Method: Kleister::ListPacks200Response#initialize
- Defined in:
- lib/kleister/models/list_packs200_response.rb
#initialize(attributes = {}) ⇒ ListPacks200Response
Initializes the object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/kleister/models/list_packs200_response.rb', line 51 def initialize(attributes = {}) unless attributes.is_a?(Hash) raise ArgumentError, 'The input argument (attributes) must be a hash in `Kleister::ListPacks200Response` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| unless self.class.attribute_map.key?(k.to_sym) raise ArgumentError, "`#{k}` is not a valid attribute in `Kleister::ListPacks200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v end self.total = if attributes.key?(:total) attributes[:total] end self.limit = if attributes.key?(:limit) attributes[:limit] end self.offset = if attributes.key?(:offset) attributes[:offset] end if attributes.key?(:packs) if (value = attributes[:packs]).is_a?(Array) self.packs = value end else self.packs = nil end end |