Class: Cal::Month
- Inherits:
-
Object
- Object
- Cal::Month
- Defined in:
- lib/cal/month.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
readonly
Returns the value of attribute calendar.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(calendar) ⇒ Month
constructor
A new instance of Month.
- #to_s ⇒ Object
Constructor Details
#initialize(calendar) ⇒ Month
Returns a new instance of Month.
4 5 6 |
# File 'lib/cal/month.rb', line 4 def initialize(calendar) @calendar = calendar end |
Instance Attribute Details
#calendar ⇒ Object (readonly)
Returns the value of attribute calendar.
8 9 10 |
# File 'lib/cal/month.rb', line 8 def calendar @calendar end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/cal/month.rb', line 10 def ==(other) other.is_a?(Month) && other.calendar == calendar end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/cal/month.rb', line 14 def to_s calendar.date.strftime "%B" end |