Class: Io::Flow::V0::Models::SyncUnitOfTime

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject (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

.ALLObject



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

.dayObject



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

.hourObject



27096
27097
27098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27096

def SyncUnitOfTime.hour
  @@_hour ||= SyncUnitOfTime.new('hour')
end

.minuteObject



27100
27101
27102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27100

def SyncUnitOfTime.minute
  @@_minute ||= SyncUnitOfTime.new('minute')
end

.secondObject



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_hashObject



27108
27109
27110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27108

def to_hash
  value
end