Sha256: c2b0e124b5ea25512a76a6f4547ecb34b6fe85a6c6602c7fae3c92c8f095f248

Contents?: true

Size: 521 Bytes

Versions: 8

Compression:

Stored size: 521 Bytes

Contents

module HyperI18n
  class Localize < Hyperloop::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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyper-i18n-0.99.6 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.5 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.4 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.3 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.2 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.1 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.99.0 lib/hyper-i18n/operations/localize.rb
hyper-i18n-0.1.1 lib/hyper-i18n/operations/localize.rb