Sha256: fc0db88845926befdae41c9d413e29ba2e7650c93bd070e883595e0230c33fd3

Contents?: true

Size: 483 Bytes

Versions: 28

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

module ActiveElement
  module Components
    # Provides `#i18n` method as standard entrypoint to translation point, specifies required
    # interface for classes that use this module.
    module Translations
      def i18n
        @i18n ||= Util::I18n.new(self)
      end

      def model
        raise NotImplementedError,
              'Component must implement `#model` and return `nil` or an ActiveRecord model class.'
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
active_element-0.0.31 lib/active_element/components/translations.rb
active_element-0.0.30 lib/active_element/components/translations.rb
active_element-0.0.29 lib/active_element/components/translations.rb
active_element-0.0.28 lib/active_element/components/translations.rb
active_element-0.0.27 lib/active_element/components/translations.rb
active_element-0.0.26 lib/active_element/components/translations.rb
active_element-0.0.24 lib/active_element/components/translations.rb
active_element-0.0.23 lib/active_element/components/translations.rb
active_element-0.0.22 lib/active_element/components/translations.rb
active_element-0.0.21 lib/active_element/components/translations.rb
active_element-0.0.19 lib/active_element/components/translations.rb
active_element-0.0.18 lib/active_element/components/translations.rb
active_element-0.0.17 lib/active_element/components/translations.rb
active_element-0.0.16 lib/active_element/components/translations.rb
active_element-0.0.15 lib/active_element/components/translations.rb
active_element-0.0.14 lib/active_element/components/translations.rb
active_element-0.0.13 lib/active_element/components/translations.rb
active_element-0.0.12 lib/active_element/components/translations.rb
active_element-0.0.11 lib/active_element/components/translations.rb
active_element-0.0.10 lib/active_element/components/translations.rb