Sha256: 94095095b4ad4e661423323eb3a1aa27ffb82476c9f91723de457a3512cfc40b

Contents?: true

Size: 370 Bytes

Versions: 1

Compression:

Stored size: 370 Bytes

Contents

# frozen_string_literal: true

require_relative "date_converter_ja/version"

module DateConverterJa
  class Error < StandardError; end

  def ampm_jp
    case self.hour
    when 12
      '昼'
    when 0
      '深夜'
    when 1..11
      '午前'
    when 13..23
      '午後'
    else
      raise 'Unpredicted time.'
    end
  end
end

class Date
  include AmPm
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
date_converter_ja-0.1.0 lib/date_converter_ja.rb