Class: Io::Flow::V0::Models::DayOfWeek
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DayOfWeek
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of DayOfWeek for this value, creating a new instance for an unknown value.
- .friday ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of DayOfWeek for this value, or nil if not found.
- .monday ⇒ Object
- .saturday ⇒ Object
- .sunday ⇒ Object
- .thursday ⇒ Object
- .tuesday ⇒ Object
- .wednesday ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ DayOfWeek
constructor
A new instance of DayOfWeek.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DayOfWeek
Returns a new instance of DayOfWeek.
18486 18487 18488 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18486 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18484 18485 18486 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18484 def value @value end |
Class Method Details
.ALL ⇒ Object
18506 18507 18508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18506 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
18491 18492 18493 18494 18495 18496 18497 18498 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18491 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 |
.friday ⇒ Object
18530 18531 18532 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18530 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
18501 18502 18503 18504 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18501 def DayOfWeek.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DayOfWeek.ALL.find { |v| v.value == value } end |
.monday ⇒ Object
18514 18515 18516 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18514 def DayOfWeek.monday @@_monday ||= DayOfWeek.new('monday') end |
.saturday ⇒ Object
18534 18535 18536 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18534 def DayOfWeek.saturday @@_saturday ||= DayOfWeek.new('saturday') end |
.sunday ⇒ Object
18510 18511 18512 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18510 def DayOfWeek.sunday @@_sunday ||= DayOfWeek.new('sunday') end |
.thursday ⇒ Object
18526 18527 18528 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18526 def DayOfWeek.thursday @@_thursday ||= DayOfWeek.new('thursday') end |
Instance Method Details
#to_hash ⇒ Object
18538 18539 18540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18538 def to_hash value end |