Class: ActiveModel::Name
Overview
minimal ActiveModel definitions so we can support I18n methods
Instance Attribute Summary collapse
-
#i18n_key ⇒ Object
readonly
Returns the value of attribute i18n_key.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Name
constructor
A new instance of Name.
- #to_s ⇒ Object
Constructor Details
#initialize(klass) ⇒ Name
Returns a new instance of Name.
6 7 8 9 10 |
# File 'lib/active_model_client_stubs.rb', line 6 def initialize(klass) @name = klass.name @klass = klass @i18n_key = :"#{@name.underscore}" end |
Instance Attribute Details
#i18n_key ⇒ Object (readonly)
Returns the value of attribute i18n_key.
4 5 6 |
# File 'lib/active_model_client_stubs.rb', line 4 def i18n_key @i18n_key end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
4 5 6 |
# File 'lib/active_model_client_stubs.rb', line 4 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/active_model_client_stubs.rb', line 4 def name @name end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/active_model_client_stubs.rb', line 12 def to_s @name end |