Class: Verizon::OffsetSystem
- Defined in:
- lib/verizon/models/offset_system.rb
Overview
The OffsetSystem data frame selects a sequence of node offsets described in the Lat-Long offset method.
Instance Attribute Summary collapse
-
#offset ⇒ Offset
The sequence of node offsets then describes a path or polygon in the Lat-Long system.
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(offset:) ⇒ OffsetSystem
constructor
A new instance of OffsetSystem.
-
#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(offset:) ⇒ OffsetSystem
Returns a new instance of OffsetSystem.
35 36 37 |
# File 'lib/verizon/models/offset_system.rb', line 35 def initialize(offset:) @offset = offset end |
Instance Attribute Details
#offset ⇒ Offset
The sequence of node offsets then describes a path or polygon in the Lat-Long system.
16 17 18 |
# File 'lib/verizon/models/offset_system.rb', line 16 def offset @offset 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/offset_system.rb', line 40 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. offset = Offset.from_hash(hash['offset']) if hash['offset'] # Create object from extracted values. OffsetSystem.new(offset: offset) end |
.names ⇒ Object
A mapping from model property names to API property names.
19 20 21 22 23 |
# File 'lib/verizon/models/offset_system.rb', line 19 def self.names @_hash = {} if @_hash.nil? @_hash['offset'] = 'offset' @_hash end |
.nullables ⇒ Object
An array for nullable fields
31 32 33 |
# File 'lib/verizon/models/offset_system.rb', line 31 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
26 27 28 |
# File 'lib/verizon/models/offset_system.rb', line 26 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verizon/models/offset_system.rb', line 52 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.offset, ->(val) { Offset.validate(val) }, is_model_hash: true) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['offset'], ->(val) { Offset.validate(val) }, is_model_hash: true) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
73 74 75 76 |
# File 'lib/verizon/models/offset_system.rb', line 73 def inspect class_name = self.class.name.split('::').last "<#{class_name} offset: #{@offset.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
67 68 69 70 |
# File 'lib/verizon/models/offset_system.rb', line 67 def to_s class_name = self.class.name.split('::').last "<#{class_name} offset: #{@offset}>" end |