Sha256: efd73b8f51a65d2f97bf111bfa826e727ae47b5a94c6454b9cff6ecad9907fbe

Contents?: true

Size: 544 Bytes

Versions: 9

Compression:

Stored size: 544 Bytes

Contents

module Zebra
  module Zpl
    module Justification
      class InvalidJustificationError < StandardError; end

      # ZPL-supported values ("L" is default)
      LEFT        = 'L'
      RIGHT       = 'R'
      CENTER      = 'C'
      JUSTIFIED   = 'J'

      def self.valid_justification?(justification)
        [LEFT, RIGHT, CENTER, JUSTIFIED].include? justification
      end

      def self.validate_justification(justification)
        raise InvalidJustificationError unless valid_justification?(justification)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
zebra-zpl-1.1.4 lib/zebra/zpl/justification.rb
zebra-zpl-1.1.3 lib/zebra/zpl/justification.rb
zebra-zpl-1.1.2 lib/zebra/zpl/justification.rb
zebra-zpl-1.1.1 lib/zebra/zpl/justification.rb
zebra-zpl-1.1.0 lib/zebra/zpl/justification.rb
zebra-zpl-1.0.5 lib/zebra/zpl/justification.rb
zebra-zpl-1.0.2 lib/zebra/zpl/justification.rb
zebra-zpl-1.0.1 lib/zebra/zpl/justification.rb
zebra-zpl-1.0.0 lib/zebra/zpl/justification.rb