Class: AwesomeTranslations::ModelInspector::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_translations/model_inspector/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_inspectorObject (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

#nameObject (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_keyObject



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_keyObject



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_keyObject



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_keyObject



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_keyObject



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_keyObject



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