Class: Asdawqw::PetPolicy
- Defined in:
- lib/asdawqw/models/pet_policy.rb
Overview
PetPolicy Model.
Instance Attribute Summary collapse
-
#allowed_pets ⇒ AllowedPetsTypeEnum
Allowed pets AllowedOnRequest, NotAllowed Allowed pets.
-
#charge_pets ⇒ String
Charge parking.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(allowed_pets = nil, charge_pets = nil) ⇒ PetPolicy
constructor
A new instance of PetPolicy.
Methods inherited from BaseModel
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_pets ⇒ AllowedPetsTypeEnum
Allowed pets AllowedOnRequest, NotAllowed Allowed pets
11 12 13 |
# File 'lib/asdawqw/models/pet_policy.rb', line 11 def allowed_pets @allowed_pets end |
#charge_pets ⇒ String
Charge parking. Example: “Free”, “$ 100”.
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 |
.names ⇒ Object
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 |