Sha256: e1cf7f830bd6fec40eef23ece22c96c444039b76c11e4a4fa780c013642df175

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

module Edtf
  module Humanize
    module Language
      module Default
        module Season
          include Edtf::Humanize::Language::Default::Formats

          extend self

          def humanizer(date)
            "#{apply_prefix_if_approximate(date)}" \
              "#{translate_season(date.season)} #{date.year}" \
              "#{apply_suffix_if_approximate(date)}" \
              "#{apply_if_uncertain(date)}"
          end

          private

          def translate_season(season)
            I18n.translate!("date.seasons.#{season}")
          rescue I18n::MissingTranslationData
            season
          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/default/season.rb