Sha256: 8f90c5abd4ed6addb654eaf18a6fe1e9e074f91ff5e1d230c59a1a4779acb146

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

# TODO: This should really be in hyper-mesh
module ActiveModel
  class Name
    attr_reader :name, :klass, :i18n_key

    def initialize(klass)
      @name     = klass.name
      @klass    = klass
      @i18n_key = :"#{@name.underscore}"
    end

    def to_s
      @name
    end

    def human
      HyperI18n::I18n.t("activerecord.models.#{i18n_key}")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper-i18n-0.99.0 lib/hyper-i18n/active_model/name.rb
hyper-i18n-0.1.1 lib/hyper-i18n/active_model/name.rb