Class: ArTranslate::TranslatedColumn
- Inherits:
-
Object
- Object
- ArTranslate::TranslatedColumn
- Defined in:
- lib/ar_translate/translated_column.rb
Constant Summary collapse
- KEYWORDS =
%w(attributes languages).freeze
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model, column, opts) ⇒ TranslatedColumn
constructor
A new instance of TranslatedColumn.
- #inject ⇒ Object
Constructor Details
#initialize(model, column, opts) ⇒ TranslatedColumn
Returns a new instance of TranslatedColumn.
8 9 10 11 12 13 14 15 |
# File 'lib/ar_translate/translated_column.rb', line 8 def initialize(model, column, opts) @model = model @column = column.to_s @langs = opts.delete(:languages) check_plural_name! check_languages! end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
6 7 8 |
# File 'lib/ar_translate/translated_column.rb', line 6 def column @column end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/ar_translate/translated_column.rb', line 6 def model @model end |
Instance Method Details
#inject ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/ar_translate/translated_column.rb', line 17 def inject define_attributes define_languages langs.each do |lang| define_reader(lang) define_writer(lang) end end |