Class: Bake::Modernize::License::Authorship::Copyright
- Inherits:
-
Struct
- Object
- Struct
- Bake::Modernize::License::Authorship::Copyright
- Defined in:
- lib/bake/modernize/license.rb
Overview
Represents the copyright for an author.
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#dates ⇒ Object
Returns the value of attribute dates.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Compare copyrights by their dates and author.
-
#statement ⇒ Object
Generate the copyright statement for the author.
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author
201 202 203 |
# File 'lib/bake/modernize/license.rb', line 201 def @author end |
#dates ⇒ Object
Returns the value of attribute dates
201 202 203 |
# File 'lib/bake/modernize/license.rb', line 201 def dates @dates end |
Instance Method Details
#<=>(other) ⇒ Object
Compare copyrights by their dates and author.
205 206 207 |
# File 'lib/bake/modernize/license.rb', line 205 def <=> other self.to_a <=> other.to_a end |
#statement ⇒ Object
Generate the copyright statement for the author.
211 212 213 214 215 |
# File 'lib/bake/modernize/license.rb', line 211 def statement years = self.dates.map(&:year).uniq period = .end_with?(".") ? "" : "." return "Copyright, #{years.join('-')}, by #{}#{period}" end |