Module: YearAfterYear::ViewHelpers
- Defined in:
- lib/year_after_year/view_helpers.rb
Instance Method Summary collapse
-
#current_year ⇒ Object
Renders the current year.
- #current_year_range(start_year = current_year, separator = '-') ⇒ Object (also: #year_range)
Instance Method Details
#current_year ⇒ Object
Renders the current year.
Example: 2008
5 6 7 |
# File 'lib/year_after_year/view_helpers.rb', line 5 def current_year Time.now.year end |
#current_year_range(start_year = current_year, separator = '-') ⇒ Object Also known as: year_range
9 10 11 |
# File 'lib/year_after_year/view_helpers.rb', line 9 def current_year_range( start_year = current_year, separator = '-' ) [start_year, current_year].sort.uniq.join(separator) end |