Class: Io::Flow::V0::Models::DayOfWeek

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) ⇒ DayOfWeek

Returns a new instance of DayOfWeek.



6951
6952
6953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6951

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6949
6950
6951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6949

def value
  @value
end

Class Method Details

.ALLObject



6971
6972
6973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6971

def DayOfWeek.ALL
  @@all ||= [DayOfWeek.sunday, DayOfWeek.monday, DayOfWeek.tuesday, DayOfWeek.wednesday, DayOfWeek.thursday, DayOfWeek.friday, DayOfWeek.saturday]
end

.apply(value) ⇒ Object

Returns the instance of DayOfWeek for this value, creating a new instance for an unknown value



6956
6957
6958
6959
6960
6961
6962
6963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6956

def DayOfWeek.apply(value)
  if value.instance_of?(DayOfWeek)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || DayOfWeek.new(value))
  end
end

.fridayObject



6995
6996
6997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6995

def DayOfWeek.friday
  @@_friday ||= DayOfWeek.new('friday')
end

.from_string(value) ⇒ Object

Returns the instance of DayOfWeek for this value, or nil if not found



6966
6967
6968
6969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6966

def DayOfWeek.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  DayOfWeek.ALL.find { |v| v.value == value }
end

.mondayObject



6979
6980
6981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6979

def DayOfWeek.monday
  @@_monday ||= DayOfWeek.new('monday')
end

.saturdayObject



6999
7000
7001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6999

def DayOfWeek.saturday
  @@_saturday ||= DayOfWeek.new('saturday')
end

.sundayObject



6975
6976
6977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6975

def DayOfWeek.sunday
  @@_sunday ||= DayOfWeek.new('sunday')
end

.thursdayObject



6991
6992
6993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6991

def DayOfWeek.thursday
  @@_thursday ||= DayOfWeek.new('thursday')
end

.tuesdayObject



6983
6984
6985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6983

def DayOfWeek.tuesday
  @@_tuesday ||= DayOfWeek.new('tuesday')
end

.wednesdayObject



6987
6988
6989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6987

def DayOfWeek.wednesday
  @@_wednesday ||= DayOfWeek.new('wednesday')
end

Instance Method Details

#to_hashObject



7003
7004
7005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7003

def to_hash
  value
end