Class: RelatonBib::DocumentStatus::Stage
- Defined in:
- lib/relaton_bib/document_status.rb
Instance Attribute Summary collapse
- #abbreviation ⇒ String, NilClass readonly
- #value ⇒ String readonly
Instance Method Summary collapse
-
#initialize(value:, abbreviation: nil) ⇒ Stage
constructor
A new instance of Stage.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(value:, abbreviation: nil) ⇒ Stage
Returns a new instance of Stage.
71 72 73 74 |
# File 'lib/relaton_bib/document_status.rb', line 71 def initialize(value:, abbreviation: nil) @value = value @abbreviation = abbreviation end |
Instance Attribute Details
#abbreviation ⇒ String, NilClass (readonly)
67 68 69 |
# File 'lib/relaton_bib/document_status.rb', line 67 def abbreviation @abbreviation end |
#value ⇒ String (readonly)
64 65 66 |
# File 'lib/relaton_bib/document_status.rb', line 64 def value @value end |
Instance Method Details
#to_hash ⇒ Hash
83 84 85 86 87 |
# File 'lib/relaton_bib/document_status.rb', line 83 def to_hash hash = { "value" => value } hash["abbreviation"] = abbreviation if abbreviation hash end |
#to_xml(builder) ⇒ Object
77 78 79 80 |
# File 'lib/relaton_bib/document_status.rb', line 77 def to_xml(builder) builder.parent[:abbreviation] = abbreviation if abbreviation builder.text value end |