Class: Asdawqw::PetPolicy

Inherits:
BaseModel show all
Defined in:
lib/asdawqw/models/pet_policy.rb

Overview

PetPolicy Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(allowed_pets = nil, charge_pets = nil) ⇒ PetPolicy

Returns a new instance of PetPolicy.



25
26
27
28
29
# File 'lib/asdawqw/models/pet_policy.rb', line 25

def initialize(allowed_pets = nil,
               charge_pets = nil)
  @allowed_pets = allowed_pets
  @charge_pets = charge_pets
end

Instance Attribute Details

#allowed_petsAllowedPetsTypeEnum

Allowed pets AllowedOnRequest, NotAllowed Allowed pets

Returns:



11
12
13
# File 'lib/asdawqw/models/pet_policy.rb', line 11

def allowed_pets
  @allowed_pets
end

#charge_petsString

Charge parking. Example: “Free”, “$ 100”.

Returns:



15
16
17
# File 'lib/asdawqw/models/pet_policy.rb', line 15

def charge_pets
  @charge_pets
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/asdawqw/models/pet_policy.rb', line 32

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  allowed_pets = hash['allowedPets']
  charge_pets = hash['chargePets']

  # Create object from extracted values.
  PetPolicy.new(allowed_pets,
                charge_pets)
end

.namesObject

A mapping from model property names to API property names.



18
19
20
21
22
23
# File 'lib/asdawqw/models/pet_policy.rb', line 18

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allowed_pets'] = 'allowedPets'
  @_hash['charge_pets'] = 'chargePets'
  @_hash
end