Class: Pubid::Iso::Amendment

Inherits:
Supplement
  • Object
show all
Defined in:
lib/pubid/iso/amendment.rb

Instance Attribute Summary

Attributes inherited from Supplement

#edition, #iteration, #publisher, #stage

Instance Method Summary collapse

Methods inherited from Supplement

#<=>, #initialize, #render_iteration, #render_pubid_number, #render_pubid_stage, #render_urn_number, #render_urn_stage

Constructor Details

This class inherits a constructor from Pubid::Iso::Supplement

Instance Method Details

#render_pubid(stage_format_long = true, with_date = true) ⇒ Object

Parameters:

  • stage_format_long (Boolean) (defaults to: true)

    long or short format for stage rendering

  • with_date (Boolean) (defaults to: true)

    include date



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pubid/iso/amendment.rb', line 5

def render_pubid(stage_format_long = true, with_date = true)
  stage = render_pubid_stage
  pubid_number = render_pubid_number(with_date: with_date)
  case stage.to_s
  when "DIS"
    if stage_format_long
      "/DAmd #{pubid_number}"
    else
      "/DAM #{pubid_number}"
    end
  when "FDIS"
    if stage_format_long
      "/FDAmd #{pubid_number}"
    else
      "/FDAM #{pubid_number}"
    end
  when "CD"
    if stage_format_long
      "/CD Amd #{pubid_number}"
    else
      "/CDAM #{pubid_number}"
    end
  when ""
    "/Amd #{pubid_number}"
  else
    "/#{stage} Amd #{pubid_number}"
  end
end

#render_urnObject



34
35
36
# File 'lib/pubid/iso/amendment.rb', line 34

def render_urn
  "#{render_urn_stage}:amd#{render_urn_number}"
end