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.



7590
7591
7592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7590

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7588
7589
7590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7588

def value
  @value
end

Class Method Details

.ALLObject



7610
7611
7612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7610

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



7595
7596
7597
7598
7599
7600
7601
7602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7595

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



7605
7606
7607
7608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7605

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

.jewish_holidaysObject



7618
7619
7620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7618

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

.us_bank_holidaysObject



7614
7615
7616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7614

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

Instance Method Details

#to_hashObject



7622
7623
7624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7622

def to_hash
  value
end