Sha256: 17d176b8312b2f451eedda2ff8a15e52623400d7614f31775687255171f0a72d

Contents?: true

Size: 604 Bytes

Versions: 18

Compression:

Stored size: 604 Bytes

Contents

module Datacaster
  module I18nValues
    class Scope < Base
      attr_reader :scope

      def initialize(scope, args = {})
        @scope = scope
        @args = args
      end

      def ==(other)
        super && @scope == other.scope
      end

      def resolve
        raise RuntimeError.new("Tried to resolve i18n scope #{@scope.inspect}. Use #i18n_key in addition to #i18n_scope.")
      end

      def with_args(args)
        self.class.new(@scope, @args.merge(args))
      end

      def inspect
        "#<#{self.class.name}(#{@scope.inspect}) #{@args.inspect}>"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
datacaster-4.1.0 lib/datacaster/i18n_values/scope.rb
datacaster-4.0.1 lib/datacaster/i18n_values/scope.rb
datacaster-3.3.1 lib/datacaster/i18n_values/scope.rb
datacaster-3.3.0 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.7 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.6 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.5 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.4 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.3 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.2 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.1 lib/datacaster/i18n_values/scope.rb
datacaster-3.2.0 lib/datacaster/i18n_values/scope.rb
datacaster-3.1.5 lib/datacaster/i18n_values/scope.rb
datacaster-3.1.3 lib/datacaster/i18n_values/scope.rb
datacaster-3.1.2 lib/datacaster/i18n_values/scope.rb
datacaster-3.1.1 lib/datacaster/i18n_values/scope.rb
datacaster-3.1.0 lib/datacaster/i18n_values/scope.rb
datacaster-3.0.0 lib/datacaster/i18n_values/scope.rb