Class: Weekday
- Inherits:
-
Object
- Object
- Weekday
- Defined in:
- lib/week_day.rb
Instance Attribute Summary collapse
-
#week_day ⇒ Object
readonly
Returns the value of attribute week_day.
Instance Method Summary collapse
-
#initialize(week_day) ⇒ Weekday
constructor
A new instance of Weekday.
- #symbol ⇒ Object
Constructor Details
#initialize(week_day) ⇒ Weekday
5 6 7 8 |
# File 'lib/week_day.rb', line 5 def initialize(week_day) @week_day = week_day @mapping = {7 => "Su", 1 => 'M', 2=> "Tu", 3 => "W", 4 => "Th", 5 => "F", 6 => "Sa"} end |
Instance Attribute Details
#week_day ⇒ Object (readonly)
Returns the value of attribute week_day.
3 4 5 |
# File 'lib/week_day.rb', line 3 def week_day @week_day end |
Instance Method Details
#symbol ⇒ Object
10 11 12 |
# File 'lib/week_day.rb', line 10 def symbol @mapping[week_day] end |