Class: ActiveAdmin::Resource::Name
- Inherits:
-
ActiveModel::Name
- Object
- ActiveModel::Name
- ActiveAdmin::Resource::Name
- Defined in:
- lib/active_admin/resource/naming.rb
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(klass, name = nil) ⇒ Name
constructor
A new instance of Name.
- #route_key ⇒ Object
- #translate(options = {}) ⇒ Object
Constructor Details
#initialize(klass, name = nil) ⇒ Name
Returns a new instance of Name.
44 45 46 |
# File 'lib/active_admin/resource/naming.rb', line 44 def initialize(klass, name = nil) super(klass, nil, name) end |
Instance Method Details
#eql?(other) ⇒ Boolean
56 57 58 |
# File 'lib/active_admin/resource/naming.rb', line 56 def eql?(other) to_str.eql?(other.to_str) end |
#route_key ⇒ Object
52 53 54 |
# File 'lib/active_admin/resource/naming.rb', line 52 def route_key plural end |
#translate(options = {}) ⇒ Object
48 49 50 |
# File 'lib/active_admin/resource/naming.rb', line 48 def translate( = {}) I18n.t i18n_key, **{ scope: [:activerecord, :models] }.merge() end |