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
7196 7197 7198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7196 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7194 7195 7196 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7194 def value @value end |
Class Method Details
.ALL ⇒ Object
7216 7217 7218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7216 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
7201 7202 7203 7204 7205 7206 7207 7208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7201 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
7240 7241 7242 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7240 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
7211 7212 7213 7214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7211 def DayOfWeek.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DayOfWeek.ALL.find { |v| v.value == value } end |
.monday ⇒ Object
7224 7225 7226 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7224 def DayOfWeek.monday @@_monday ||= DayOfWeek.new('monday') end |
.saturday ⇒ Object
7244 7245 7246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7244 def DayOfWeek.saturday @@_saturday ||= DayOfWeek.new('saturday') end |
.sunday ⇒ Object
7220 7221 7222 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7220 def DayOfWeek.sunday @@_sunday ||= DayOfWeek.new('sunday') end |
.thursday ⇒ Object
7236 7237 7238 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7236 def DayOfWeek.thursday @@_thursday ||= DayOfWeek.new('thursday') end |
Instance Method Details
#to_hash ⇒ Object
7248 7249 7250 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7248 def to_hash value end |