Class: Io::Flow::V0::Models::HolidayCalendar
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HolidayCalendar
- 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 HolidayCalendar for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of HolidayCalendar for this value, or nil if not found.
- .jewish_holidays ⇒ Object
- .us_bank_holidays ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ HolidayCalendar
constructor
A new instance of HolidayCalendar.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ HolidayCalendar
Returns a new instance of HolidayCalendar.
16086 16087 16088 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16086 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16084 16085 16086 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16084 def value @value end |
Class Method Details
.ALL ⇒ Object
16106 16107 16108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16106 def HolidayCalendar.ALL @@all ||= [HolidayCalendar.us_bank_holidays, HolidayCalendar.jewish_holidays] end |
.apply(value) ⇒ Object
Returns the instance of HolidayCalendar for this value, creating a new instance for an unknown value
16091 16092 16093 16094 16095 16096 16097 16098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16091 def HolidayCalendar.apply(value) if value.instance_of?(HolidayCalendar) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || HolidayCalendar.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of HolidayCalendar for this value, or nil if not found
16101 16102 16103 16104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16101 def HolidayCalendar.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) HolidayCalendar.ALL.find { |v| v.value == value } end |
.jewish_holidays ⇒ Object
16114 16115 16116 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16114 def HolidayCalendar.jewish_holidays @@_jewish_holidays ||= HolidayCalendar.new('jewish_holidays') end |
.us_bank_holidays ⇒ Object
16110 16111 16112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16110 def HolidayCalendar.us_bank_holidays @@_us_bank_holidays ||= HolidayCalendar.new('us_bank_holidays') end |
Instance Method Details
#to_hash ⇒ Object
16118 16119 16120 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16118 def to_hash value end |