Class: Bake::Modernize::License::Authorship::Copyright

Inherits:
Struct
  • Object
show all
Defined in:
lib/bake/modernize/license.rb

Overview

Represents the copyright for an author.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorObject

Returns the value of attribute author

Returns:

  • (Object)

    the current value of author



186
187
188
# File 'lib/bake/modernize/license.rb', line 186

def author
  @author
end

#datesObject

Returns the value of attribute dates

Returns:

  • (Object)

    the current value of dates



186
187
188
# File 'lib/bake/modernize/license.rb', line 186

def dates
  @dates
end

Instance Method Details

#<=>(other) ⇒ Object



187
188
189
# File 'lib/bake/modernize/license.rb', line 187

def <=> other
	self.to_a <=> other.to_a
end

#statementObject



191
192
193
194
# File 'lib/bake/modernize/license.rb', line 191

def statement
	years = self.dates.map(&:year).uniq
	return "Copyright, #{years.join('-')}, by #{author}."
end