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.



6399
6400
6401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6399

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6397
6398
6399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6397

def value
  @value
end

Class Method Details

.ALLObject



6419
6420
6421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6419

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



6404
6405
6406
6407
6408
6409
6410
6411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6404

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



6443
6444
6445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6443

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



6414
6415
6416
6417
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6414

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

.mondayObject



6427
6428
6429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6427

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

.saturdayObject



6447
6448
6449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6447

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

.sundayObject



6423
6424
6425
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6423

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

.thursdayObject



6439
6440
6441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6439

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

.tuesdayObject



6431
6432
6433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6431

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

.wednesdayObject



6435
6436
6437
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6435

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

Instance Method Details

#to_hashObject



6451
6452
6453
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6451

def to_hash
  value
end