Class: Verizon::NodeLLmD64B
- Defined in:
- lib/verizon/models/node_l_lm_d64_b.rb
Overview
A 64-bit node type with lat-long values expressed in standard SAE 1/10th of a microdegree.
Instance Attribute Summary collapse
-
#lat ⇒ Integer
The geographic latitude of an object, expressed in 1/10th integer microdegrees, as a 31 bit value, and with reference to the horizontal datum then in use.
-
#lon ⇒ Integer
The geographic longitude of an object, expressed in 1/10th integer microdegrees, as a 32-bit value, and with reference to the horizontal datum then in use.
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(lon:, lat:) ⇒ NodeLLmD64B
constructor
A new instance of NodeLLmD64B.
-
#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(lon:, lat:) ⇒ NodeLLmD64B
Returns a new instance of NodeLLmD64B.
43 44 45 46 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 43 def initialize(lon:, lat:) @lon = lon @lat = lat end |
Instance Attribute Details
#lat ⇒ Integer
The geographic latitude of an object, expressed in 1/10th integer microdegrees, as a 31 bit value, and with reference to the horizontal datum then in use. The value 900000001 shall be used when unavailable.
23 24 25 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 23 def lat @lat end |
#lon ⇒ Integer
The geographic longitude of an object, expressed in 1/10th integer microdegrees, as a 32-bit value, and with reference to the horizontal datum then in use. The value 1800000001 shall be used when unavailable.
17 18 19 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 17 def lon @lon end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 49 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. lon = hash.key?('lon') ? hash['lon'] : nil lat = hash.key?('lat') ? hash['lat'] : nil # Create object from extracted values. NodeLLmD64B.new(lon: lon, lat: lat) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['lon'] = 'lon' @_hash['lat'] = 'lat' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 39 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 34 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 63 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.lon, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.lat, ->(val) { val.instance_of? Integer }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['lon'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['lat'], ->(val) { val.instance_of? Integer }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
90 91 92 93 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} lon: #{@lon.inspect}, lat: #{@lat.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 |
# File 'lib/verizon/models/node_l_lm_d64_b.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} lon: #{@lon}, lat: #{@lat}>" end |