Class: Enrico::VacationDay
- Inherits:
-
Object
- Object
- Enrico::VacationDay
- Defined in:
- lib/enrico/vacation_day.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#english_name ⇒ Object
Returns the value of attribute english_name.
-
#local_name ⇒ Object
Returns the value of attribute local_name.
Instance Method Summary collapse
-
#initialize(args) ⇒ VacationDay
constructor
A new instance of VacationDay.
Constructor Details
#initialize(args) ⇒ VacationDay
Returns a new instance of VacationDay.
7 8 9 10 11 |
# File 'lib/enrico/vacation_day.rb', line 7 def initialize(args) self.date = Date.new( args["date"]["year"].to_i, args["date"]["month"].to_i, args["date"]["day"].to_i ) self.local_name = args["name"][0]["text"] self.english_name = args["name"][1].present? ? args["name"][1]["text"] : args["name"][0]["text"] end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/enrico/vacation_day.rb', line 5 def date @date end |
#english_name ⇒ Object
Returns the value of attribute english_name.
5 6 7 |
# File 'lib/enrico/vacation_day.rb', line 5 def english_name @english_name end |
#local_name ⇒ Object
Returns the value of attribute local_name.
5 6 7 |
# File 'lib/enrico/vacation_day.rb', line 5 def local_name @local_name end |