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.



16393
16394
16395
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16393

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16391
16392
16393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16391

def value
  @value
end

Class Method Details

.ALLObject



16413
16414
16415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16413

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



16398
16399
16400
16401
16402
16403
16404
16405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16398

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



16437
16438
16439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16437

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



16408
16409
16410
16411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16408

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

.mondayObject



16421
16422
16423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16421

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

.saturdayObject



16441
16442
16443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16441

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

.sundayObject



16417
16418
16419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16417

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

.thursdayObject



16433
16434
16435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16433

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

.tuesdayObject



16425
16426
16427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16425

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

.wednesdayObject



16429
16430
16431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16429

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

Instance Method Details

#to_hashObject



16445
16446
16447
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16445

def to_hash
  value
end