Module: Translator::Translates::ClassMethods
- Defined in:
- lib/translator/translates.rb
Instance Method Summary collapse
- #prefixed_attributes ⇒ Object
- #translated_attributes ⇒ Object
- #translates(*args) ⇒ Object
- #translates?(name) ⇒ Boolean
Instance Method Details
#prefixed_attributes ⇒ Object
59 60 61 |
# File 'lib/translator/translates.rb', line 59 def prefixed_attributes @prefixed_attributes ||= translated_attributes.map{ |a| Translator.prefixed(a) }.flatten end |
#translated_attributes ⇒ Object
55 56 57 |
# File 'lib/translator/translates.rb', line 55 def translated_attributes @translated_attributes ||= [] end |
#translates(*args) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/translator/translates.rb', line 43 def translates *args self.translated_attributes = args self.translated_attributes.each do |name| translated_attr_accessor name translations_attr_accessor name end end |
#translates?(name) ⇒ Boolean
51 52 53 |
# File 'lib/translator/translates.rb', line 51 def translates? name self.translated_attributes.include? name end |