Class: Verizon::CauseCodeChoice
- Defined in:
- lib/verizon/models/cause_code_choice.rb
Overview
CauseCodeChoice Model.
Instance Attribute Summary collapse
-
#traffic_condition1 ⇒ Integer
The value shall be set to: - 0 ‘unavailable` - in case further detailed information on the traffic condition is unavailable, - 1 `increasedVolumeOfTraffic` - in case the type of traffic condition is increased traffic volume, - 2 `trafficJamSlowlyIncreasing` - in case the type of traffic condition is a traffic jam which volume is increasing slowly, - 3 `trafficJamIncreasing` - in case the type of traffic condition is a traffic jam which volume is increasing, - 4 `trafficJamStronglyIncreasing` - in case the type of traffic condition is a traffic jam which volume is strongly increasing, - 5 `trafficJam` ` - in case the type of traffic condition is a traffic jam and no further detailed information about its volume is available, - 6 `trafficJamSlightlyDecreasing` - in case the type of traffic condition is a traffic jam which volume is decreasing slowly, - 7 `trafficJamDecreasing` - in case the type of traffic condition is a traffic jam which volume is decreasing, - 8 `trafficJamStronglyDecreasing` - in case the type of traffic condition is a traffic jam which volume is decreasing rapidly, - 9 `trafficJamStable` - in case the traffic condition is a traffic jam with stable volume, - 10-255: reserved for future usage.
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(traffic_condition1 = nil) ⇒ CauseCodeChoice
constructor
A new instance of CauseCodeChoice.
-
#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(traffic_condition1 = nil) ⇒ CauseCodeChoice
Returns a new instance of CauseCodeChoice.
55 56 57 |
# File 'lib/verizon/models/cause_code_choice.rb', line 55 def initialize(traffic_condition1 = nil) @traffic_condition1 = traffic_condition1 end |
Instance Attribute Details
#traffic_condition1 ⇒ Integer
The value shall be set to:
-
0 ‘unavailable` - in case further detailed information
on the traffic condition is unavailable,
-
1 ‘increasedVolumeOfTraffic` - in case the type of traffic condition
is increased traffic volume,
-
2 ‘trafficJamSlowlyIncreasing` - in case the type of traffic condition
is a traffic jam which volume is increasing slowly,
-
3 ‘trafficJamIncreasing` - in case the type of traffic condition
is a traffic jam which volume is increasing,
-
4 ‘trafficJamStronglyIncreasing` - in case the type of traffic condition
is a traffic jam which volume is strongly increasing,
-
5 ‘trafficJam` ` - in case the type of traffic condition
is a traffic jam and no further detailed information about its volume is available,
-
6 ‘trafficJamSlightlyDecreasing` - in case the type of traffic condition
is a traffic jam which volume is decreasing slowly,
-
7 ‘trafficJamDecreasing` - in case the type of traffic condition
is a traffic jam which volume is decreasing,
-
8 ‘trafficJamStronglyDecreasing` - in case the type of traffic condition
is a traffic jam which volume is decreasing rapidly,
-
9 ‘trafficJamStable` - in case the traffic condition is a
traffic jam with stable volume,
-
10-255: reserved for future usage.
36 37 38 |
# File 'lib/verizon/models/cause_code_choice.rb', line 36 def traffic_condition1 @traffic_condition1 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/verizon/models/cause_code_choice.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. traffic_condition1 = hash.key?('trafficCondition1') ? hash['trafficCondition1'] : nil # Create object from extracted values. CauseCodeChoice.new(traffic_condition1) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 |
# File 'lib/verizon/models/cause_code_choice.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['traffic_condition1'] = 'trafficCondition1' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/verizon/models/cause_code_choice.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 |
# File 'lib/verizon/models/cause_code_choice.rb', line 46 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/verizon/models/cause_code_choice.rb', line 73 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.traffic_condition1, ->(val) { val.instance_of? Integer }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['trafficCondition1'], ->(val) { val.instance_of? Integer }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
92 93 94 95 |
# File 'lib/verizon/models/cause_code_choice.rb', line 92 def inspect class_name = self.class.name.split('::').last "<#{class_name} traffic_condition1: #{@traffic_condition1.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 |
# File 'lib/verizon/models/cause_code_choice.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} traffic_condition1: #{@traffic_condition1}>" end |