Class: Pubid::Etsi::Identifiers::Base
- Inherits:
-
Identifier
- Object
- Lutaml::Model::Serializable
- Identifier
- Pubid::Etsi::Identifiers::Base
- Defined in:
- lib/pubid/etsi/identifiers/base.rb
Overview
Base class for all ETSI identifiers
Direct Known Subclasses
Instance Method Summary collapse
- #==(other) ⇒ Object
- #publisher ⇒ Object
- #to_s ⇒ Object
-
#type ⇒ String
Generate URN for this identifier.
Methods inherited from Identifier
#base_identifier, #eql?, #exclude, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, #render, #resolve_urn_generator, #root, #to_mr_string, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code
Constructor Details
This class inherits a constructor from Pubid::Identifier
Instance Method Details
#==(other) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/pubid/etsi/identifiers/base.rb', line 27 def ==(other) return false unless other.is_a?(Base) type == other.type && code == other.code && version == other.version && date == other.date end |
#publisher ⇒ Object
16 17 18 |
# File 'lib/pubid/etsi/identifiers/base.rb', line 16 def publisher "ETSI" end |
#to_s ⇒ Object
20 21 22 23 24 25 |
# File 'lib/pubid/etsi/identifiers/base.rb', line 20 def to_s result = "#{publisher} #{type} #{code}" result += " #{version} (#{date.year}-#{date.month.to_s.rjust(2, '0')})" result end |
#type ⇒ String
Generate URN for this identifier
11 |
# File 'lib/pubid/etsi/identifiers/base.rb', line 11 attribute :type, :string |