Class: Ingreedy::Dictionary
- Inherits:
-
Object
- Object
- Ingreedy::Dictionary
- Defined in:
- lib/ingreedy/dictionary.rb
Instance Attribute Summary collapse
-
#numbers ⇒ Object
readonly
Returns the value of attribute numbers.
-
#prepositions ⇒ Object
readonly
Returns the value of attribute prepositions.
-
#units ⇒ Object
readonly
Returns the value of attribute units.
Instance Method Summary collapse
-
#initialize(entries = {}) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #vulgar_fractions ⇒ Object
Constructor Details
#initialize(entries = {}) ⇒ Dictionary
Returns a new instance of Dictionary.
5 6 7 8 9 |
# File 'lib/ingreedy/dictionary.rb', line 5 def initialize(entries = {}) @units = entries[:units] || raise("No units found in dictionary") @numbers = entries[:numbers] || {} @prepositions = entries[:prepositions] || [] end |
Instance Attribute Details
#numbers ⇒ Object (readonly)
Returns the value of attribute numbers.
3 4 5 |
# File 'lib/ingreedy/dictionary.rb', line 3 def numbers @numbers end |
#prepositions ⇒ Object (readonly)
Returns the value of attribute prepositions.
3 4 5 |
# File 'lib/ingreedy/dictionary.rb', line 3 def prepositions @prepositions end |
#units ⇒ Object (readonly)
Returns the value of attribute units.
3 4 5 |
# File 'lib/ingreedy/dictionary.rb', line 3 def units @units end |
Instance Method Details
#vulgar_fractions ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ingreedy/dictionary.rb', line 12 def vulgar_fractions { "\u00BC" => "1/4", "\u00BD" => "1/2", "\u00BE" => "3/4", "\u2150" => "1/7", "\u2151" => "1/9", "\u2152" => "1/10", "\u2153" => "1/3", "\u2154" => "2/3", "\u2155" => "1/5", "\u2156" => "2/5", "\u2157" => "3/5", "\u2158" => "4/5", "\u2159" => "1/6", "\u215A" => "5/6", "\u215B" => "1/8", "\u215C" => "3/8", "\u215D" => "5/8", "\u215E" => "7/8", } end |