Class: Io::Flow::V0::Models::SyncUnitOfTime
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SyncUnitOfTime
- Defined in:
- lib/flow_commerce/flow_api_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 SyncUnitOfTime for this value, creating a new instance for an unknown value.
- .day ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of SyncUnitOfTime for this value, or nil if not found.
- .hour ⇒ Object
- .minute ⇒ Object
- .second ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ SyncUnitOfTime
constructor
A new instance of SyncUnitOfTime.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ SyncUnitOfTime
Returns a new instance of SyncUnitOfTime.
27068 27069 27070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27068 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
27066 27067 27068 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27066 def value @value end |
Class Method Details
.ALL ⇒ Object
27088 27089 27090 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27088 def SyncUnitOfTime.ALL @@all ||= [SyncUnitOfTime.day, SyncUnitOfTime.hour, SyncUnitOfTime.minute, SyncUnitOfTime.second] end |
.apply(value) ⇒ Object
Returns the instance of SyncUnitOfTime for this value, creating a new instance for an unknown value
27073 27074 27075 27076 27077 27078 27079 27080 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27073 def SyncUnitOfTime.apply(value) if value.instance_of?(SyncUnitOfTime) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || SyncUnitOfTime.new(value)) end end |
.day ⇒ Object
27092 27093 27094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27092 def SyncUnitOfTime.day @@_day ||= SyncUnitOfTime.new('day') end |
.from_string(value) ⇒ Object
Returns the instance of SyncUnitOfTime for this value, or nil if not found
27083 27084 27085 27086 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27083 def SyncUnitOfTime.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SyncUnitOfTime.ALL.find { |v| v.value == value } end |
.hour ⇒ Object
27096 27097 27098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27096 def SyncUnitOfTime.hour @@_hour ||= SyncUnitOfTime.new('hour') end |
.minute ⇒ Object
27100 27101 27102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27100 def SyncUnitOfTime.minute @@_minute ||= SyncUnitOfTime.new('minute') end |
.second ⇒ Object
27104 27105 27106 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27104 def SyncUnitOfTime.second @@_second ||= SyncUnitOfTime.new('second') end |
Instance Method Details
#to_hash ⇒ Object
27108 27109 27110 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27108 def to_hash value end |