Sha256: 518e5b0c999162cff1eac0b4fbedf6e293ae6ddd216b114133c109a7096fc5d0

Contents?: true

Size: 305 Bytes

Versions: 2

Compression:

Stored size: 305 Bytes

Contents

module Stamp
  module Emitters
    class AmPm
      include Modifiable

      AM = 'am'
      PM = 'pm'

      def initialize(&block)
        @modifier = block
      end

      def format(target)
        modify(target.hour < 12 ? AM : PM)
      end

      def field
        nil
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stamp-0.6.0 lib/stamp/emitters/am_pm.rb
stamp-0.5.0 lib/stamp/emitters/am_pm.rb