Class: Io::Flow::Reference::V0::Models::ProvinceType
- Inherits:
-
Object
- Object
- Io::Flow::Reference::V0::Models::ProvinceType
- Defined in:
- lib/flow_reference_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of ProvinceType for this value, creating a new instance for an unknown value.
- .city ⇒ Object
- .dependency ⇒ Object
- .district ⇒ Object
- .emirate ⇒ Object
- .entity ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of ProvinceType for this value, or nil if not found.
- .municipality ⇒ Object
- .other ⇒ Object
- .outlying_area ⇒ Object
- .parish ⇒ Object
- .province ⇒ Object
- .state ⇒ Object
- .territory ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ ProvinceType
constructor
A new instance of ProvinceType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ProvinceType
Returns a new instance of ProvinceType.
328 329 330 |
# File 'lib/flow_reference_v0_client.rb', line 328 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
326 327 328 |
# File 'lib/flow_reference_v0_client.rb', line 326 def value @value end |
Class Method Details
.ALL ⇒ Object
348 349 350 |
# File 'lib/flow_reference_v0_client.rb', line 348 def ProvinceType.ALL @@all ||= [ProvinceType.city, ProvinceType.dependency, ProvinceType.district, ProvinceType.emirate, ProvinceType.entity, ProvinceType.municipality, ProvinceType., ProvinceType.parish, ProvinceType.province, ProvinceType.state, ProvinceType.territory, ProvinceType.other] end |
.apply(value) ⇒ Object
Returns the instance of ProvinceType for this value, creating a new instance for an unknown value
333 334 335 336 337 338 339 340 |
# File 'lib/flow_reference_v0_client.rb', line 333 def ProvinceType.apply(value) if value.instance_of?(ProvinceType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ProvinceType.new(value)) end end |
.city ⇒ Object
352 353 354 |
# File 'lib/flow_reference_v0_client.rb', line 352 def ProvinceType.city @@_city ||= ProvinceType.new('city') end |
.dependency ⇒ Object
356 357 358 |
# File 'lib/flow_reference_v0_client.rb', line 356 def ProvinceType.dependency @@_dependency ||= ProvinceType.new('dependency') end |
.district ⇒ Object
360 361 362 |
# File 'lib/flow_reference_v0_client.rb', line 360 def ProvinceType.district @@_district ||= ProvinceType.new('district') end |
.emirate ⇒ Object
364 365 366 |
# File 'lib/flow_reference_v0_client.rb', line 364 def ProvinceType.emirate @@_emirate ||= ProvinceType.new('emirate') end |
.entity ⇒ Object
368 369 370 |
# File 'lib/flow_reference_v0_client.rb', line 368 def ProvinceType.entity @@_entity ||= ProvinceType.new('entity') end |
.from_string(value) ⇒ Object
Returns the instance of ProvinceType for this value, or nil if not found
343 344 345 346 |
# File 'lib/flow_reference_v0_client.rb', line 343 def ProvinceType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ProvinceType.ALL.find { |v| v.value == value } end |
.municipality ⇒ Object
372 373 374 |
# File 'lib/flow_reference_v0_client.rb', line 372 def ProvinceType.municipality @@_municipality ||= ProvinceType.new('municipality') end |
.other ⇒ Object
396 397 398 |
# File 'lib/flow_reference_v0_client.rb', line 396 def ProvinceType.other @@_other ||= ProvinceType.new('other') end |
.outlying_area ⇒ Object
376 377 378 |
# File 'lib/flow_reference_v0_client.rb', line 376 def ProvinceType. @@_outlying_area ||= ProvinceType.new('outlying_area') end |
.parish ⇒ Object
380 381 382 |
# File 'lib/flow_reference_v0_client.rb', line 380 def ProvinceType.parish @@_parish ||= ProvinceType.new('parish') end |
.province ⇒ Object
384 385 386 |
# File 'lib/flow_reference_v0_client.rb', line 384 def ProvinceType.province @@_province ||= ProvinceType.new('province') end |
.state ⇒ Object
388 389 390 |
# File 'lib/flow_reference_v0_client.rb', line 388 def ProvinceType.state @@_state ||= ProvinceType.new('state') end |
.territory ⇒ Object
392 393 394 |
# File 'lib/flow_reference_v0_client.rb', line 392 def ProvinceType.territory @@_territory ||= ProvinceType.new('territory') end |
Instance Method Details
#to_hash ⇒ Object
400 401 402 |
# File 'lib/flow_reference_v0_client.rb', line 400 def to_hash value end |