Class: BankHolidays::BankHoliday
- Inherits:
-
Object
- Object
- BankHolidays::BankHoliday
- Defined in:
- lib/bank_holidays.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(date, summary = '') ⇒ BankHoliday
constructor
A new instance of BankHoliday.
Constructor Details
#initialize(date, summary = '') ⇒ BankHoliday
Returns a new instance of BankHoliday.
17 18 19 20 |
# File 'lib/bank_holidays.rb', line 17 def initialize(date, summary='') @date = date @summary = summary end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
16 17 18 |
# File 'lib/bank_holidays.rb', line 16 def date @date end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
16 17 18 |
# File 'lib/bank_holidays.rb', line 16 def summary @summary end |
Instance Method Details
#as_json ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/bank_holidays.rb', line 22 def as_json { title: summary, start: date.rfc822, end: date.rfc822 } end |