Sha256: 4a279cec0d637fbf3121d8fb651723a8d9b53a0e2190c2782f42252d9d6d8bc7

Contents?: true

Size: 870 Bytes

Versions: 4

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

require "relaton_bib/localized_string"

module RelatonBib
  # Dovument status.
  class DocumentStatus
    # @return [String]
    attr_reader :stage

    # @return [String, NilClass]
    attr_reader :substage

    # @return [String, NilClass]
    attr_reader :iteration

    # @param stage [String]
    # @param substage [String, NilClass]
    # @param iteration [String, NilClass]
    def initialize(stage:, substage: nil, iteration: nil)
      @stage = stage
      @substage = substage
      @iteration = iteration
    end

    # @param [Nokogiri::XML::Builder]
    def to_xml(builder)
      builder.status do
        # FormattedString.instance_method(:to_xml).bind(status).call builder
        builder.stage stage
        builder.substage substage if substage
        builder.iteration iteration if iteration
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
relaton-bib-0.2.1 lib/relaton_bib/document_status.rb
relaton-bib-0.2.0 lib/relaton_bib/document_status.rb
relaton-bib-0.1.6 lib/relaton_bib/document_status.rb
relaton-bib-0.1.5 lib/relaton_bib/document_status.rb