Class: PPCurses::MetaMonth
- Inherits:
-
Object
- Object
- PPCurses::MetaMonth
- Defined in:
- lib/ppcurses/date/meta_month.rb
Overview
A container object that holds:
-
A date object
-
The month the day belongs to in string array format
-
The row and column position of the date in the string array
This container is used for displaying dates in the datepicker. The row and column position are necessary so that the day selected can be highlighted.
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#day_pos ⇒ Object
Returns the value of attribute day_pos.
-
#month_str_array ⇒ Object
Returns the value of attribute month_str_array.
Instance Method Summary collapse
- #day_col ⇒ Object
- #day_row ⇒ Object
-
#initialize(day = Date.today) ⇒ MetaMonth
constructor
A new instance of MetaMonth.
Constructor Details
#initialize(day = Date.today) ⇒ MetaMonth
Returns a new instance of MetaMonth.
119 120 121 |
# File 'lib/ppcurses/date/meta_month.rb', line 119 def initialize(day=Date.today) self.day = day end |
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
115 116 117 |
# File 'lib/ppcurses/date/meta_month.rb', line 115 def day @day end |
#day_pos ⇒ Object
Returns the value of attribute day_pos.
117 118 119 |
# File 'lib/ppcurses/date/meta_month.rb', line 117 def day_pos @day_pos end |
#month_str_array ⇒ Object
Returns the value of attribute month_str_array.
116 117 118 |
# File 'lib/ppcurses/date/meta_month.rb', line 116 def month_str_array @month_str_array end |
Instance Method Details
#day_col ⇒ Object
132 133 134 |
# File 'lib/ppcurses/date/meta_month.rb', line 132 def day_col @day_pos[ @day.day ][1] end |
#day_row ⇒ Object
128 129 130 |
# File 'lib/ppcurses/date/meta_month.rb', line 128 def day_row @day_pos[ @day.day ][0] end |