Class: TwitterCldr::LocalizedObject

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/core_ext/localized_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, locale, options = {}) ⇒ LocalizedObject

Returns a new instance of LocalizedObject.


10
11
12
13
14
15
16
17
18
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 10

def initialize(obj, locale, options = {})
  @base_obj = obj
  @locale = locale

  options = options.dup
  options[:locale] ||= @locale

  @formatter = formatter_const.new(options) if formatter_const
end

Instance Attribute Details

#base_objObject (readonly)

Returns the value of attribute base_obj


8
9
10
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8

def base_obj
  @base_obj
end

#formatterObject (readonly)

Returns the value of attribute formatter


8
9
10
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8

def formatter
  @formatter
end

#localeObject (readonly)

Returns the value of attribute locale


8
9
10
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8

def locale
  @locale
end

Instance Method Details

#formatter_constObject

Raises:

  • (NotImplementedError)

20
21
22
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 20

def formatter_const
  raise NotImplementedError
end