Class: Pubid::Itu::Identifiers::Supplement
- Defined in:
- lib/pubid/itu/identifiers/supplement.rb
Overview
Supplement identifier (Suppl.) Pattern: "ITU-T H Suppl. 1", "ITU-T E.156 Suppl. 2"
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#==(other) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/pubid/itu/identifiers/supplement.rb', line 34 def ==(other) return false unless other.is_a?(Supplement) base == other.base && number == other.number && date == other.date end |
#to_s ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pubid/itu/identifiers/supplement.rb', line 12 def to_s result = base ? base.to_s : "#{publisher}-#{sector}" # Add series if no base if !base && series result += " #{series}" end result += " Suppl. #{number}" # Add date if present if date result += if date.month " (#{date.month}/#{date.year})" else " (#{date.year})" end end result end |