Class: Verizon::GeographicalPath
- Defined in:
- lib/verizon/models/geographical_path.rb
Overview
The data frame is used to support the cross-cutting need in many V2X messages to describe arbitrary spatial areas (polygons, boundary lines, and other basic shapes) required by various message types in a small message size.
Instance Attribute Summary collapse
-
#description ⇒ GeographicalPathDescription
This data frame can describe a complex path of arbitrary size using node offset method (LL offsets).
-
#direction ⇒ String
This data frame can describe a complex path of arbitrary size using node offset method (LL offsets).
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(description: SKIP, direction: SKIP) ⇒ GeographicalPath
constructor
A new instance of GeographicalPath.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(description: SKIP, direction: SKIP) ⇒ GeographicalPath
Returns a new instance of GeographicalPath.
46 47 48 49 |
# File 'lib/verizon/models/geographical_path.rb', line 46 def initialize(description: SKIP, direction: SKIP) @description = description unless description == SKIP @direction = direction unless direction == SKIP end |
Instance Attribute Details
#description ⇒ GeographicalPathDescription
This data frame can describe a complex path of arbitrary size using node offset method (LL offsets).
18 19 20 |
# File 'lib/verizon/models/geographical_path.rb', line 18 def description @description end |
#direction ⇒ String
This data frame can describe a complex path of arbitrary size using node offset method (LL offsets).
23 24 25 |
# File 'lib/verizon/models/geographical_path.rb', line 23 def direction @direction end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/geographical_path.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = GeographicalPathDescription.from_hash(hash['description']) if hash['description'] direction = hash.key?('direction') ? hash['direction'] : SKIP # Create object from extracted values. GeographicalPath.new(description: description, direction: direction) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 |
# File 'lib/verizon/models/geographical_path.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['direction'] = 'direction' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/verizon/models/geographical_path.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/verizon/models/geographical_path.rb', line 34 def self.optionals %w[ description direction ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
67 68 69 70 71 72 73 |
# File 'lib/verizon/models/geographical_path.rb', line 67 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
82 83 84 85 |
# File 'lib/verizon/models/geographical_path.rb', line 82 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, direction: #{@direction.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
76 77 78 79 |
# File 'lib/verizon/models/geographical_path.rb', line 76 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, direction: #{@direction}>" end |