Class: IsoBibItem::IsoDocumentStatus
- Inherits:
-
DocumentStatus
- Object
- DocumentStatus
- IsoBibItem::IsoDocumentStatus
- Defined in:
- lib/iso_bib_item/iso_document_status.rb
Overview
ISO Document status.
Instance Attribute Summary collapse
- #iteration ⇒ Integer, NilClass readonly
- #stage ⇒ String, NilClass readonly
- #substage ⇒ String, NilClass readonly
Attributes inherited from DocumentStatus
Instance Method Summary collapse
-
#initialize(status: nil, stage: nil, substage: nil, iteration: nil) ⇒ IsoDocumentStatus
constructor
A new instance of IsoDocumentStatus.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(status: nil, stage: nil, substage: nil, iteration: nil) ⇒ IsoDocumentStatus
Returns a new instance of IsoDocumentStatus.
44 45 46 47 48 49 50 |
# File 'lib/iso_bib_item/iso_document_status.rb', line 44 def initialize(status: nil, stage: nil, substage: nil, iteration: nil) raise ArgumentError, 'status or stage is required' unless status || stage super LocalizedString.new(status) @stage = stage @substage = substage @iteration = iteration end |
Instance Attribute Details
#iteration ⇒ Integer, NilClass (readonly)
38 39 40 |
# File 'lib/iso_bib_item/iso_document_status.rb', line 38 def iteration @iteration end |
#stage ⇒ String, NilClass (readonly)
32 33 34 |
# File 'lib/iso_bib_item/iso_document_status.rb', line 32 def stage @stage end |
#substage ⇒ String, NilClass (readonly)
35 36 37 |
# File 'lib/iso_bib_item/iso_document_status.rb', line 35 def substage @substage end |
Instance Method Details
#to_xml(builder) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/iso_bib_item/iso_document_status.rb', line 53 def to_xml(builder) if stage.nil? || stage.empty? super else builder.status do builder.stage stage builder.substage substage if substage builder.iteration iteration if iteration end end end |