Sha256: c4e42d25206e3c23cde90faccf0a60dedf242c9e72f773d24d28fcd3dbaed6b4

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

module Edtf
  module Humanize
    module Language
      module Italian
        include Default

        module Century
          extend self

          def humanizer(date)
            require 'roman'
            "#{((date.year.abs / 100) + 1).to_roman}" \
              "#{century_number_suffix}" \
              "#{century_sign_suffix(date)}"
          end

          private

          def century_number_suffix
            ' secolo'
          end

          def century_sign_suffix(date)
            return ' a. C.' if date.year.negative?

            ''
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
edtf-humanize-2.2.0 lib/edtf/humanize/language/italian.rb