Class: javajava::util::Locale
- Defined in:
- lib/jactive_support/json/encoders/locale.rb,
lib/jactive_support/java_ext/locale.rb
Class Method Summary collapse
Instance Method Summary collapse
- #human_name ⇒ Object
- #inspect ⇒ Object
-
#to_json(options = {}) ⇒ Object
:nodoc:.
- #to_locale ⇒ Object
- #to_str ⇒ Object
- #to_sym ⇒ Object
Class Method Details
.current_locale ⇒ Object
4 5 6 |
# File 'lib/jactive_support/java_ext/locale.rb', line 4 def self.current_locale self.getDefault end |
.current_locale=(l) ⇒ Object
8 9 10 |
# File 'lib/jactive_support/java_ext/locale.rb', line 8 def self.current_locale=(l) self.setDefault(l.to_locale) end |
Instance Method Details
#human_name ⇒ Object
16 17 18 19 20 21 |
# File 'lib/jactive_support/java_ext/locale.rb', line 16 def human_name l = Locale.current_locale display_country = country.blank? ? "" : " (#{getDisplayCountry(l)})" display_variant = variant.blank? ? "" : " - #{getDisplayVariant(l)}" "#{getDisplayLanguage(l)}#{display_country}#{display_variant}" end |
#inspect ⇒ Object
23 24 25 |
# File 'lib/jactive_support/java_ext/locale.rb', line 23 def inspect "Locale[#{human_name}]" end |
#to_json(options = {}) ⇒ Object
:nodoc:
3 4 5 |
# File 'lib/jactive_support/json/encoders/locale.rb', line 3 def to_json( = {}) #:nodoc: ActiveSupport::JSON.encode(to_s) end |
#to_locale ⇒ Object
12 13 14 |
# File 'lib/jactive_support/java_ext/locale.rb', line 12 def to_locale self end |
#to_str ⇒ Object
27 28 29 |
# File 'lib/jactive_support/java_ext/locale.rb', line 27 def to_str to_s end |
#to_sym ⇒ Object
31 32 33 |
# File 'lib/jactive_support/java_ext/locale.rb', line 31 def to_sym to_s.to_sym end |