class Io::Flow::V0::Models::UnitOfTime
Attributes
value[R]
Public Class Methods
ALL()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28199 def UnitOfTime.ALL @@all ||= [UnitOfTime.year, UnitOfTime.month, UnitOfTime.week, UnitOfTime.day, UnitOfTime.hour, UnitOfTime.minute] end
apply(value)
click to toggle source
Returns the instance of UnitOfTime
for this value, creating a new instance for an unknown value
# File lib/flow_commerce/flow_api_v0_client.rb, line 28184 def UnitOfTime.apply(value) if value.instance_of?(UnitOfTime) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || UnitOfTime.new(value)) end end
day()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28215 def UnitOfTime.day @@_day ||= UnitOfTime.new('day') end
from_string(value)
click to toggle source
Returns the instance of UnitOfTime
for this value, or nil if not found
# File lib/flow_commerce/flow_api_v0_client.rb, line 28194 def UnitOfTime.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) UnitOfTime.ALL.find { |v| v.value == value } end
hour()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28219 def UnitOfTime.hour @@_hour ||= UnitOfTime.new('hour') end
minute()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28223 def UnitOfTime.minute @@_minute ||= UnitOfTime.new('minute') end
month()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28207 def UnitOfTime.month @@_month ||= UnitOfTime.new('month') end
new(value)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28179 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end
week()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28211 def UnitOfTime.week @@_week ||= UnitOfTime.new('week') end
year()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28203 def UnitOfTime.year @@_year ||= UnitOfTime.new('year') end
Public Instance Methods
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 28227 def to_hash value end