Module: Numerouno::Parser

Extended by:
CombinerMethods, SearchMethods
Defined in:
lib/numerouno/parser.rb

Class Method Summary collapse

Methods included from CombinerMethods

combine

Methods included from SearchMethods

numbers_within

Class Method Details

.number_from(string) ⇒ Object



7
8
9
10
11
# File 'lib/numerouno/parser.rb', line 7

def self.number_from string
  numbers = numbers_within string 
  numbers.empty? ? raise(NoNumberFoundError, "No number found in string: #{string}") :
    total(numbers)
end