Sha256: 6042ec98dc52053e24a8611163299cc8395fda6b684c0809767d0149eaa65c7c

Contents?: true

Size: 638 Bytes

Versions: 7

Compression:

Stored size: 638 Bytes

Contents

module Hyperstack
  module Internal
    class I18n
      class Localize < Hyperstack::ServerOp
        include HelperMethods

        param :acting_user, nils: true
        param :date_or_time
        param :format
        param :opts
        param :localization, default: nil

        def date_or_time
          @date_or_time ||= formatted_date_or_time(params.date_or_time)
        end

        def opts
          @opts ||= params.opts.with_indifferent_access.merge(format: formatted_format(params.format))
        end

        step do
          params.localization = ::I18n.l(date_or_time, opts)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hyper-i18n-1.0.alpha1.4 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.alpha1.3 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.alpha1.2 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.alpha1.1 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.0.pre.alpha1 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.alpha1 lib/hyperstack/internal/i18n/localize.rb
hyper-i18n-1.0.pre.alpha1 lib/hyperstack/internal/i18n/localize.rb