Class: Pubid::Iec::Components::Publisher

Inherits:
Components::Publisher show all
Defined in:
lib/pubid/iec/components/publisher.rb

Constant Summary collapse

PUBLISHERS =
{
  "IEC" => "International Electrotechnical Commission",
  "ISO/IEC" => "ISO/IEC Joint Technical Committee",
  "CISPR" => "International Special Committee on Radio Interference",
  "IECEE" => "IEC System of Conformity Assessment Schemes for Electrotechnical Equipment and Components",
  "IECEx" => "IEC System for Certification to Standards Relating to Equipment for Use in Explosive Atmospheres",
  "IECQ" => "IEC Quality Assessment System for Electronic Components",
}.freeze

Instance Method Summary collapse

Methods inherited from Components::Publisher

#eql?, #hash, #render

Instance Method Details

#full_nameObject



30
31
32
# File 'lib/pubid/iec/components/publisher.rb', line 30

def full_name
  PUBLISHERS[body]
end

#to_sObject



26
27
28
# File 'lib/pubid/iec/components/publisher.rb', line 26

def to_s
  body
end

#validate!Object



20
21
22
23
24
# File 'lib/pubid/iec/components/publisher.rb', line 20

def validate!
  unless PUBLISHERS.key?(body)
    raise ArgumentError, "Unknown IEC publisher: #{body}"
  end
end