Class: PunctuationName::Punctuation
- Inherits:
-
Object
- Object
- PunctuationName::Punctuation
- Defined in:
- lib/punctuation_name.rb
Overview
To go here
Class Method Summary collapse
- .custom(name, dict) ⇒ Object
- .name(punctuation, dict_name = 'uk') ⇒ Object
- .name_from_dictionary(punctuation, dict) ⇒ Object
- .setup ⇒ Object
Class Method Details
.custom(name, dict) ⇒ Object
23 24 25 |
# File 'lib/punctuation_name.rb', line 23 def self.custom(name, dict) $dict[name] = dict end |
.name(punctuation, dict_name = 'uk') ⇒ Object
31 32 33 34 35 36 37 38 39 |
# 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) ⇒ Object
27 28 29 |
# File 'lib/punctuation_name.rb', line 27 def self.name_from_dictionary(punctuation, dict) dict.key?(punctuation) ? dict[punctuation] : punctuation end |