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.
12674 12675 12676 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12674 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12672 12673 12674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12672 def value @value end |
Class Method Details
.ALL ⇒ Object
12694 12695 12696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12694 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
12679 12680 12681 12682 12683 12684 12685 12686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12679 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
12689 12690 12691 12692 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12689 def HolidayCalendar.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) HolidayCalendar.ALL.find { |v| v.value == value } end |
.jewish_holidays ⇒ Object
12702 12703 12704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12702 def HolidayCalendar.jewish_holidays @@_jewish_holidays ||= HolidayCalendar.new('jewish_holidays') end |
.us_bank_holidays ⇒ Object
12698 12699 12700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12698 def HolidayCalendar.us_bank_holidays @@_us_bank_holidays ||= HolidayCalendar.new('us_bank_holidays') end |
Instance Method Details
#to_hash ⇒ Object
12706 12707 12708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12706 def to_hash value end |