Class: PPCurses::MetaMonth

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#dayObject

Returns the value of attribute day.



115
116
117
# File 'lib/ppcurses/date/meta_month.rb', line 115

def day
  @day
end

#day_posObject

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_arrayObject

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_colObject



132
133
134
# File 'lib/ppcurses/date/meta_month.rb', line 132

def day_col
  @day_pos[ @day.day ][1]
end

#day_rowObject



128
129
130
# File 'lib/ppcurses/date/meta_month.rb', line 128

def day_row
  @day_pos[ @day.day ][0]
end