class CopyrightPresenter::Copyright

Attributes

company[R]
start_year[R]

Public Class Methods

new( company, start_year=Time.now.strftime( '%Y' ) ) click to toggle source
# File lib/copyright_presenter/copyright.rb, line 9
def initialize( company, start_year=Time.now.strftime( '%Y' ) )
  @company    = company
  @start_year = start_year
end

Public Instance Methods

long( options={:single_year => false} ) click to toggle source
# File lib/copyright_presenter/copyright.rb, line 14
def long( options={:single_year => false} )
  "#{short( options )} All Rights Reserved."
end
short( options={:single_year => false} ) click to toggle source
# File lib/copyright_presenter/copyright.rb, line 18
def short( options={:single_year => false} )
  "Copyright #{symbol} #{years( options )} #{company}."
end
symbol() click to toggle source
# File lib/copyright_presenter/copyright.rb, line 22
def symbol
  "©"
end

Protected Instance Methods

current_year() click to toggle source
# File lib/copyright_presenter/copyright.rb, line 28
def current_year
  Time.now.strftime( '%Y' )
end
years( options ) click to toggle source
# File lib/copyright_presenter/copyright.rb, line 32
def years( options )
  if options[:single_year] || start_year == current_year
    return current_year
  end

  return "#{start_year} - #{current_year}"
end