Sha256: cf7e0f845b8cf3a20c9cc3ba9a157b5406e498320fd0141e318d281f1c7c07dd

Contents?: true

Size: 727 Bytes

Versions: 20

Compression:

Stored size: 727 Bytes

Contents

# frozen_string_literal: true

module Vedeu

  module Coercers

    # Provides the mechanism to validate a vertical alignment value.
    #
    # @api private
    #
    class VerticalAlignment < Vedeu::Coercers::Alignment

      # @macro raise_invalid_syntax
      # @return (see Vedeu::Coercers::Alignment#validate)
      def validate
        return coerce if valid_vertical?

        raise Vedeu::Error::InvalidSyntax,
              'Missing or invalid vertical alignment value. ' \
              "Valid values are: #{to_sentence}"
      end

      private

      # @return [String]
      def to_sentence
        Vedeu::Sentence.construct(vertical_values)
      end

    end # VerticalAlignment

  end # Coercers

end # Vedeu

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
vedeu-0.8.32 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.31 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.30 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.29 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.28 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.27 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.26 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.25 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.24 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.23 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.22 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.21 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.20 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.19 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.18 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.17 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.16 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.15 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.14 lib/vedeu/coercers/vertical_alignment.rb
vedeu-0.8.13 lib/vedeu/coercers/vertical_alignment.rb