Module: CopyrightMafa
- Defined in:
- lib/copyright_mafa.rb,
lib/copyright_mafa/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
Instance Method Summary collapse
Instance Method Details
#copyright(start_year, company_name = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/copyright_mafa.rb', line 4 def copyright(start_year, company_name = nil) start_year = start_year.to_i current_year = Time.new.year years = if current_year > start_year && start_year > 2000 "#{start_year} - #{current_year}" elsif start_year > 2000 start_year.to_s else current_year.to_s end if company_name "© #{company_name} #{years}".html_safe else years end end |