Class: AwesomeTranslations::ModelInspector::Attribute
- Inherits:
-
Object
- Object
- AwesomeTranslations::ModelInspector::Attribute
- Defined in:
- lib/awesome_translations/model_inspector/attribute.rb
Instance Attribute Summary collapse
-
#model_inspector ⇒ Object
readonly
Returns the value of attribute model_inspector.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #i18n_key ⇒ Object
-
#initialize(model_inspector, name) ⇒ Attribute
constructor
A new instance of Attribute.
- #simple_form_hint_key ⇒ Object
- #simple_form_include_blank_key ⇒ Object
- #simple_form_label_key ⇒ Object
- #simple_form_placeholder_key ⇒ Object
- #simple_form_prompt_key ⇒ Object
Constructor Details
#initialize(model_inspector, name) ⇒ Attribute
Returns a new instance of Attribute.
4 5 6 7 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 4 def initialize(model_inspector, name) @model_inspector = model_inspector @name = name end |
Instance Attribute Details
#model_inspector ⇒ Object (readonly)
Returns the value of attribute model_inspector.
2 3 4 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 2 def model_inspector @model_inspector end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 2 def name @name end |
Instance Method Details
#i18n_key ⇒ Object
9 10 11 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 9 def i18n_key "activerecord.attributes.#{@model_inspector.snake_name}.#{@name}" end |
#simple_form_hint_key ⇒ Object
21 22 23 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 21 def simple_form_hint_key "simple_form.hints.#{@model_inspector.snake_name}.#{@name}" end |
#simple_form_include_blank_key ⇒ Object
13 14 15 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 13 def simple_form_include_blank_key "simple_form.include_blanks.#{@model_inspector.snake_name}.#{@name}" end |
#simple_form_label_key ⇒ Object
17 18 19 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 17 def simple_form_label_key "simple_form.labels.#{@model_inspector.snake_name}.#{@name}" end |
#simple_form_placeholder_key ⇒ Object
25 26 27 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 25 def simple_form_placeholder_key "simple_form.placeholders.#{@model_inspector.snake_name}.#{@name}" end |
#simple_form_prompt_key ⇒ Object
29 30 31 |
# File 'lib/awesome_translations/model_inspector/attribute.rb', line 29 def simple_form_prompt_key "simple_form.prompts.#{@model_inspector.snake_name}.#{@name}" end |