class PunctuationName::Punctuation

To go here

Public Class Methods

custom(name, dict) click to toggle source
# File lib/punctuation_name.rb, line 23
def self.custom(name, dict)
    $dict[name] = dict
end
name(punctuation, dict_name = 'uk') click to toggle source
# File lib/punctuation_name.rb, line 31
def self.name(punctuation, dict_name = 'uk')
    setup

    dict_name = 'uk' if dict_name.empty?

    return punctuation unless $dict.key?(dict_name)

    name_from_dictionary(punctuation, $dict[dict_name])
end
name_from_dictionary(punctuation, dict) click to toggle source
# File lib/punctuation_name.rb, line 27
def self.name_from_dictionary(punctuation, dict)
    dict.key?(punctuation) ? dict[punctuation] : punctuation
end
setup() click to toggle source
# File lib/punctuation_name.rb, line 18
def self.setup
    $dict['uk'] = UK_NAMES
    $dict['us'] = US_NAMES
end