Class: TwitterCldr::Shared::PropertyNameAliases

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/shared/property_name_aliases.rb

Class Method Summary collapse

Class Method Details

.abbreviated_alias_for(long_name) ⇒ Object



12
13
14
# File 'lib/twitter_cldr/shared/property_name_aliases.rb', line 12

def abbreviated_alias_for(long_name)
  index.fetch(long_name, nil)
end

.aliases_for(property_name) ⇒ Object



20
21
22
23
24
25
# File 'lib/twitter_cldr/shared/property_name_aliases.rb', line 20

def aliases_for(property_name)
  fields = (resource[property_name] || {})
  Array(fields[:long_name]) +
    Array(fields[:additional]) +
    Array(index[property_name])
end

.long_alias_for(abbreviated_name) ⇒ Object



16
17
18
# File 'lib/twitter_cldr/shared/property_name_aliases.rb', line 16

def long_alias_for(abbreviated_name)
  resource.fetch(abbreviated_name, {}).fetch(:long_name, nil)
end