class DailyLog::Day
Represents one calendar Day
Constants
- DATE_FORMAT
Format for dates when printed as stringss
Attributes
date[R]
The Date object for this Day
Public Class Methods
new(date)
click to toggle source
Create a new day
date - A valid Date object
# File lib/daily_log/day.rb, line 20 def initialize(date) @date = date end
Public Instance Methods
to_s()
click to toggle source
Print the date as a formatted string
Returns String
# File lib/daily_log/day.rb, line 34 def to_s date.strftime(DATE_FORMAT) end
today?()
click to toggle source
Is this Day
today's calendar Date?
Returns Boolean
# File lib/daily_log/day.rb, line 27 def today? @date == Date.today end