Module: LocalizationBuffer

Included in:
Date, DateTime, Time
Defined in:
lib/amelia/active_support/core_ext/localization_buffer.rb

Instance Method Summary collapse

Instance Method Details

#format(arg) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/amelia/active_support/core_ext/localization_buffer.rb', line 19

def format arg
  if @options.blank?
    @options = {format: arg}
  else
    @options[:format] = arg
  end
  self
end

#internationalization(virtual_path = nil) ⇒ Object Also known as: i18n



2
3
4
# File 'lib/amelia/active_support/core_ext/localization_buffer.rb', line 2

def internationalization virtual_path = nil
  I18n.l self, (@options ||= {})
end

#internationalization_options(options = {}) ⇒ Object Also known as: io



12
13
14
15
# File 'lib/amelia/active_support/core_ext/localization_buffer.rb', line 12

def internationalization_options options = {}
  @options = options
  self
end

#translate_falseObject



28
29
30
31
# File 'lib/amelia/active_support/core_ext/localization_buffer.rb', line 28

def translate_false
  @translate_flag = false
  self
end

#translate_flag?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/amelia/active_support/core_ext/localization_buffer.rb', line 6

def translate_flag?
  !defined?(@translate_flag) || @translate_flag
end