Class: HolidaysRest::Holiday
- Inherits:
-
Data
- Object
- Data
- HolidaysRest::Holiday
- Defined in:
- lib/holidays_rest/models.rb
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#is_estimate ⇒ Object
readonly
Returns the value of attribute is_estimate.
-
#is_local ⇒ Object
readonly
Returns the value of attribute is_local.
-
#is_national ⇒ Object
readonly
Returns the value of attribute is_national.
-
#is_religious ⇒ Object
readonly
Returns the value of attribute is_religious.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#regions ⇒ Object
readonly
Returns the value of attribute regions.
-
#religion ⇒ Object
readonly
Returns the value of attribute religion.
Class Method Summary collapse
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def country_code @country_code end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def country_name @country_name end |
#date ⇒ Object (readonly)
Returns the value of attribute date
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def date @date end |
#day ⇒ Object (readonly)
Returns the value of attribute day
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def day @day end |
#is_estimate ⇒ Object (readonly)
Returns the value of attribute is_estimate
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def is_estimate @is_estimate end |
#is_local ⇒ Object (readonly)
Returns the value of attribute is_local
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def is_local @is_local end |
#is_national ⇒ Object (readonly)
Returns the value of attribute is_national
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def is_national @is_national end |
#is_religious ⇒ Object (readonly)
Returns the value of attribute is_religious
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def is_religious @is_religious end |
#name ⇒ Object (readonly)
Returns the value of attribute name
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def name @name end |
#regions ⇒ Object (readonly)
Returns the value of attribute regions
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def regions @regions end |
#religion ⇒ Object (readonly)
Returns the value of attribute religion
11 12 13 |
# File 'lib/holidays_rest/models.rb', line 11 def religion @religion end |
Class Method Details
.from_hash(h) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/holidays_rest/models.rb', line 14 def self.from_hash(h) new( country_code: h.fetch("country_code", ""), country_name: h.fetch("country_name", ""), date: h.fetch("date", ""), name: h.fetch("name", {}), is_national: h.fetch("isNational", false), is_religious: h.fetch("isReligious", false), is_local: h.fetch("isLocal", false), is_estimate: h.fetch("isEstimate", false), day: HolidayDay.from_hash(h.fetch("day", {})), religion: h.fetch("religion", ""), regions: Array(h["regions"]) ) end |