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



195
196
197
# File 'lib/bake/modernize/license.rb', line 195

def author
  @author
end

#datesObject

Returns the value of attribute dates

Returns:

  • (Object)

    the current value of dates



195
196
197
# File 'lib/bake/modernize/license.rb', line 195

def dates
  @dates
end

Instance Method Details

#<=>(other) ⇒ Object



196
197
198
# File 'lib/bake/modernize/license.rb', line 196

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

#statementObject



200
201
202
203
204
# File 'lib/bake/modernize/license.rb', line 200

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