Class: Io::Flow::V0::Models::HolidayCalendar

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) ⇒ HolidayCalendar

Returns a new instance of HolidayCalendar.



16599
16600
16601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16599

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16597
16598
16599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16597

def value
  @value
end

Class Method Details

.ALLObject



16619
16620
16621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16619

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



16604
16605
16606
16607
16608
16609
16610
16611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16604

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



16614
16615
16616
16617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16614

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

.jewish_holidaysObject



16627
16628
16629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16627

def HolidayCalendar.jewish_holidays
  @@_jewish_holidays ||= HolidayCalendar.new('jewish_holidays')
end

.us_bank_holidaysObject



16623
16624
16625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16623

def HolidayCalendar.us_bank_holidays
  @@_us_bank_holidays ||= HolidayCalendar.new('us_bank_holidays')
end

Instance Method Details

#to_hashObject



16631
16632
16633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16631

def to_hash
  value
end