Class: Pubid::Core::Edition
- Inherits:
-
Object
- Object
- Pubid::Core::Edition
- Includes:
- Comparable
- Defined in:
- lib/pubid/core/edition.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#number ⇒ Object
Returns the value of attribute number.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(config:, year: nil, number: nil) ⇒ Edition
constructor
A new instance of Edition.
Constructor Details
#initialize(config:, year: nil, number: nil) ⇒ Edition
Returns a new instance of Edition.
6 7 8 9 10 |
# File 'lib/pubid/core/edition.rb', line 6 def initialize(config:, year: nil, number: nil) @config = config @year = year @number = number end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/pubid/core/edition.rb', line 4 def config @config end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/pubid/core/edition.rb', line 4 def number @number end |
#year ⇒ Object
Returns the value of attribute year.
4 5 6 |
# File 'lib/pubid/core/edition.rb', line 4 def year @year end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/pubid/core/edition.rb', line 12 def <=>(other) if other.year && year return number <=> other.number if year == other.year year <=> other.year else number <=> other.number end end |