Module: Ingreedy
- Defined in:
- lib/ingreedy.rb,
lib/ingreedy/version.rb,
lib/ingreedy/dictionary.rb,
lib/ingreedy/root_parser.rb,
lib/ingreedy/rationalizer.rb,
lib/ingreedy/amount_parser.rb,
lib/ingreedy/ingreedy_parser.rb,
lib/ingreedy/dictionary_collection.rb,
lib/ingreedy/unit_variation_mapper.rb,
lib/ingreedy/case_insensitive_parser.rb
Defined Under Namespace
Modules: CaseInsensitiveParser Classes: AmountParser, Dictionary, DictionaryCollection, Parser, Rationalizer, RootParser, UnitVariationMapper
Constant Summary collapse
- ParseFailed =
Class.new(StandardError)
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.locale ⇒ Object
Returns the value of attribute locale.
-
.preserve_amounts ⇒ Object
Returns the value of attribute preserve_amounts.
Class Method Summary collapse
Class Attribute Details
.locale ⇒ Object
Returns the value of attribute locale.
11 12 13 |
# File 'lib/ingreedy.rb', line 11 def locale @locale end |
.preserve_amounts ⇒ Object
Returns the value of attribute preserve_amounts.
11 12 13 |
# File 'lib/ingreedy.rb', line 11 def preserve_amounts @preserve_amounts end |
Class Method Details
.dictionaries ⇒ Object
21 22 23 |
# File 'lib/ingreedy.rb', line 21 def self.dictionaries @dictionaries ||= DictionaryCollection.new end |
.parse(query) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/ingreedy.rb', line 14 def self.parse(query) parser = Parser.new(query) parser.parse rescue Parslet::ParseFailed => e fail ParseFailed.new(e.), e.backtrace end |