Class: Asdawqw::ParkingPolicy

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

Overview

ParkingPolicy Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(access_parking = nil, located_parking = nil, private_parking = nil, charge_parking = nil, time_cost_parking = nil, necessary_reservation_parking = nil) ⇒ ParkingPolicy

Returns a new instance of ParkingPolicy.



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/asdawqw/models/parking_policy.rb', line 46

def initialize(access_parking = nil,
               located_parking = nil,
               private_parking = nil,
               charge_parking = nil,
               time_cost_parking = nil,
               necessary_reservation_parking = nil)
  @access_parking = access_parking
  @located_parking = located_parking
  @private_parking = private_parking
  @charge_parking = charge_parking
  @time_cost_parking = time_cost_parking
  @necessary_reservation_parking = necessary_reservation_parking
end

Instance Attribute Details

#access_parkingBoolean

Access parking into properties true,false

Returns:

  • (Boolean)


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

def access_parking
  @access_parking
end

#charge_parkingString

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

Returns:



23
24
25
# File 'lib/asdawqw/models/parking_policy.rb', line 23

def charge_parking
  @charge_parking
end

#located_parkingLocatedParkingTypeEnum

Located parking Nearby



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

def located_parking
  @located_parking
end

#necessary_reservation_parkingReservationParkingTypeEnum

Necessary reservation parking NotPossible, ReservationNeeded Necessary reservation parking



32
33
34
# File 'lib/asdawqw/models/parking_policy.rb', line 32

def necessary_reservation_parking
  @necessary_reservation_parking
end

#private_parkingBoolean

Parking is private or no. true,false

Returns:

  • (Boolean)


19
20
21
# File 'lib/asdawqw/models/parking_policy.rb', line 19

def private_parking
  @private_parking
end

#time_cost_parkingTimeCostParkingEnum

Time cost parking PerWeek, PerStay, PerDay

Returns:



27
28
29
# File 'lib/asdawqw/models/parking_policy.rb', line 27

def time_cost_parking
  @time_cost_parking
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/asdawqw/models/parking_policy.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  access_parking = hash['accessParking']
  located_parking = hash['locatedParking']
  private_parking = hash['privateParking']
  charge_parking = hash['chargeParking']
  time_cost_parking = hash['timeCostParking']
  necessary_reservation_parking = hash['necessaryReservationParking']

  # Create object from extracted values.
  ParkingPolicy.new(access_parking,
                    located_parking,
                    private_parking,
                    charge_parking,
                    time_cost_parking,
                    necessary_reservation_parking)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
43
44
# File 'lib/asdawqw/models/parking_policy.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['access_parking'] = 'accessParking'
  @_hash['located_parking'] = 'locatedParking'
  @_hash['private_parking'] = 'privateParking'
  @_hash['charge_parking'] = 'chargeParking'
  @_hash['time_cost_parking'] = 'timeCostParking'
  @_hash['necessary_reservation_parking'] = 'necessaryReservationParking'
  @_hash
end