Class: ZendeskAppsTools::LocaleIdentifier
- Inherits:
-
Object
- Object
- ZendeskAppsTools::LocaleIdentifier
- Defined in:
- lib/zendesk_apps_tools/locale_identifier.rb
Instance Attribute Summary collapse
-
#locale_id ⇒ Object
readonly
Returns the value of attribute locale_id.
Instance Method Summary collapse
-
#initialize(code) ⇒ LocaleIdentifier
constructor
Convert :“en-US-x-12” to ‘en-US’.
Constructor Details
#initialize(code) ⇒ LocaleIdentifier
Convert :“en-US-x-12” to ‘en-US’
6 7 8 |
# File 'lib/zendesk_apps_tools/locale_identifier.rb', line 6 def initialize(code) @locale_id = code.start_with?('en-US') ? 'en-US' : code.sub(/-x-.*/, '').downcase end |
Instance Attribute Details
#locale_id ⇒ Object (readonly)
Returns the value of attribute locale_id.
3 4 5 |
# File 'lib/zendesk_apps_tools/locale_identifier.rb', line 3 def locale_id @locale_id end |