Class: Verizon::GeographicalPathDescription

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/geographical_path_description.rb

Overview

This data frame can describe a complex path of arbitrary size using node offset method (LL offsets).

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(path:) ⇒ GeographicalPathDescription

Returns a new instance of GeographicalPathDescription.



35
36
37
# File 'lib/verizon/models/geographical_path_description.rb', line 35

def initialize(path:)
  @path = path
end

Instance Attribute Details

#pathOffsetSystem

The OffsetSystem data frame selects a sequence of node offsets described in the Lat-Long offset method.

Returns:



16
17
18
# File 'lib/verizon/models/geographical_path_description.rb', line 16

def path
  @path
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



40
41
42
43
44
45
46
47
48
# File 'lib/verizon/models/geographical_path_description.rb', line 40

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  path = OffsetSystem.from_hash(hash['path']) if hash['path']

  # Create object from extracted values.
  GeographicalPathDescription.new(path: path)
end

.namesObject

A mapping from model property names to API property names.



19
20
21
22
23
# File 'lib/verizon/models/geographical_path_description.rb', line 19

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['path'] = 'path'
  @_hash
end

.nullablesObject

An array for nullable fields



31
32
33
# File 'lib/verizon/models/geographical_path_description.rb', line 31

def self.nullables
  []
end

.optionalsObject

An array for optional fields



26
27
28
# File 'lib/verizon/models/geographical_path_description.rb', line 26

def self.optionals
  []
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/verizon/models/geographical_path_description.rb', line 52

def self.validate(value)
  if value.instance_of? self
    return APIHelper.valid_type?(value.path,
                                 ->(val) { OffsetSystem.validate(val) },
                                 is_model_hash: true)
  end

  return false unless value.instance_of? Hash

  APIHelper.valid_type?(value['path'],
                        ->(val) { OffsetSystem.validate(val) },
                        is_model_hash: true)
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



73
74
75
76
# File 'lib/verizon/models/geographical_path_description.rb', line 73

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} path: #{@path.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



67
68
69
70
# File 'lib/verizon/models/geographical_path_description.rb', line 67

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} path: #{@path}>"
end