Class: UspsApi::AdditionalFacilityDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/usps_api/models/additional_facility_details.rb

Overview

Information about the drop-off location facility.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(dock: SKIP, canopy_clearance: SKIP, lift_types: SKIP, ramps: SKIP, truck_maneuvering_area: SKIP, levelers: SKIP, door_details: SKIP, overpass_details: SKIP) ⇒ AdditionalFacilityDetails

Returns a new instance of AdditionalFacilityDetails.



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/usps_api/models/additional_facility_details.rb', line 80

def initialize(dock: SKIP, canopy_clearance: SKIP, lift_types: SKIP,
               ramps: SKIP, truck_maneuvering_area: SKIP, levelers: SKIP,
               door_details: SKIP, overpass_details: SKIP)
  @dock = dock unless dock == SKIP
  @canopy_clearance = canopy_clearance unless canopy_clearance == SKIP
  @lift_types = lift_types unless lift_types == SKIP
  @ramps = ramps unless ramps == SKIP
  @truck_maneuvering_area = truck_maneuvering_area unless truck_maneuvering_area == SKIP
  @levelers = levelers unless levelers == SKIP
  @door_details = door_details unless door_details == SKIP
  @overpass_details = overpass_details unless overpass_details == SKIP
end

Instance Attribute Details

#canopy_clearanceInteger

Clearance between the yard surface and the underside of the loading / unloading area canopy or overhang (in feet).

Returns:

  • (Integer)


19
20
21
# File 'lib/usps_api/models/additional_facility_details.rb', line 19

def canopy_clearance
  @canopy_clearance
end

#dockDock

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/usps_api/models/additional_facility_details.rb', line 14

def dock
  @dock
end

#door_detailsDoorDetails

Information regarding the dock door size and yard surface distance to the loading dock door.

Returns:



40
41
42
# File 'lib/usps_api/models/additional_facility_details.rb', line 40

def door_details
  @door_details
end

#levelersLevelers

The amount of levelers, by leveler type, available at a facility.

Returns:



35
36
37
# File 'lib/usps_api/models/additional_facility_details.rb', line 35

def levelers
  @levelers
end

#lift_typesLiftTypes

Types of lifts available at the facility.

Returns:



23
24
25
# File 'lib/usps_api/models/additional_facility_details.rb', line 23

def lift_types
  @lift_types
end

#overpass_detailsOverpassDetails

The number of overpasses and the lowest overpass height between the facility and the highway exit.

Returns:



45
46
47
# File 'lib/usps_api/models/additional_facility_details.rb', line 45

def overpass_details
  @overpass_details
end

#rampsRamps

Details on ramps available at the facility.

Returns:



27
28
29
# File 'lib/usps_api/models/additional_facility_details.rb', line 27

def ramps
  @ramps
end

#truck_maneuvering_areaTruckManeuveringArea

Details on the maneuvering area at the facility.



31
32
33
# File 'lib/usps_api/models/additional_facility_details.rb', line 31

def truck_maneuvering_area
  @truck_maneuvering_area
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/usps_api/models/additional_facility_details.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dock = Dock.from_hash(hash['dock']) if hash['dock']
  canopy_clearance =
    hash.key?('canopyClearance') ? hash['canopyClearance'] : SKIP
  lift_types = LiftTypes.from_hash(hash['liftTypes']) if hash['liftTypes']
  ramps = Ramps.from_hash(hash['ramps']) if hash['ramps']
  truck_maneuvering_area = TruckManeuveringArea.from_hash(hash['truckManeuveringArea']) if
    hash['truckManeuveringArea']
  levelers = Levelers.from_hash(hash['levelers']) if hash['levelers']
  door_details = DoorDetails.from_hash(hash['doorDetails']) if hash['doorDetails']
  overpass_details = OverpassDetails.from_hash(hash['overpassDetails']) if
    hash['overpassDetails']

  # Create object from extracted values.
  AdditionalFacilityDetails.new(dock: dock,
                                canopy_clearance: canopy_clearance,
                                lift_types: lift_types,
                                ramps: ramps,
                                truck_maneuvering_area: truck_maneuvering_area,
                                levelers: levelers,
                                door_details: door_details,
                                overpass_details: overpass_details)
end

.namesObject

A mapping from model property names to API property names.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/usps_api/models/additional_facility_details.rb', line 48

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dock'] = 'dock'
  @_hash['canopy_clearance'] = 'canopyClearance'
  @_hash['lift_types'] = 'liftTypes'
  @_hash['ramps'] = 'ramps'
  @_hash['truck_maneuvering_area'] = 'truckManeuveringArea'
  @_hash['levelers'] = 'levelers'
  @_hash['door_details'] = 'doorDetails'
  @_hash['overpass_details'] = 'overpassDetails'
  @_hash
end

.nullablesObject

An array for nullable fields



76
77
78
# File 'lib/usps_api/models/additional_facility_details.rb', line 76

def self.nullables
  []
end

.optionalsObject

An array for optional fields



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/usps_api/models/additional_facility_details.rb', line 62

def self.optionals
  %w[
    dock
    canopy_clearance
    lift_types
    ramps
    truck_maneuvering_area
    levelers
    door_details
    overpass_details
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
137
# File 'lib/usps_api/models/additional_facility_details.rb', line 131

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dock: #{@dock.inspect}, canopy_clearance: #{@canopy_clearance.inspect},"\
  " lift_types: #{@lift_types.inspect}, ramps: #{@ramps.inspect}, truck_maneuvering_area:"\
  " #{@truck_maneuvering_area.inspect}, levelers: #{@levelers.inspect}, door_details:"\
  " #{@door_details.inspect}, overpass_details: #{@overpass_details.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
128
# File 'lib/usps_api/models/additional_facility_details.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dock: #{@dock}, canopy_clearance: #{@canopy_clearance}, lift_types:"\
  " #{@lift_types}, ramps: #{@ramps}, truck_maneuvering_area: #{@truck_maneuvering_area},"\
  " levelers: #{@levelers}, door_details: #{@door_details}, overpass_details:"\
  " #{@overpass_details}>"
end