module PlayWhe module Parser PATTERN = /Draw #: <\/strong>(?\d+).*?Date: <\/strong>(?\d{1,2})-(?[A-Z]{3})-(?\d{2}).*?Mark Drawn: <\/strong>(?\d+).*?Drawn at: <\/strong>(?[A-Z]{2})/i def self.parse(html_results) html_results.to_enum(:scan, PATTERN).map do m = $~ date = "#{m[:day]}-#{m[:month]}-#{m[:year]}" Result.new \ draw: m[:draw], date: date, mark: m[:mark], period: m[:period] end end end end