Class: Pubid::Ieee::Identifiers::Nesc::Handbook

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/ieee/identifiers/nesc/handbook.rb

Overview

NESC Handbook identifier

Represents NESC Handbook publications which provide comprehensive guidance and interpretation of the National Electrical Safety Code.

Examples:

Basic handbook

nesc = Pubid::Ieee.parse("2012 NESC Handbook")
nesc.to_s  # => "2012 NESC Handbook"

With edition

nesc = Pubid::Ieee.parse("2017 NESC Handbook, Premier Edition")
nesc.to_s  # => "2017 NESC Handbook, Premier Edition"

Instance Method Summary collapse

Methods inherited from Base

#publisher_portion

Instance Method Details

#to_sString

Render handbook identifier

Returns:

  • (String)

    YYYY NESC Handbook format with optional edition



23
24
25
26
27
# File 'lib/pubid/ieee/identifiers/nesc/handbook.rb', line 23

def to_s
  parts = ["#{year.year} NESC Handbook"]
  parts << ", #{edition}" if edition
  parts.join
end