lib/egp_rates/cae.rb
def raw_exchange_rates
      table_rows = Oga.parse_html(response.body).css('#f_box option')
      # CAE porvide 17 currencies on the home page but with header
      # and an empty row in the end
      fail ResponseError, 'Unknown HTML' unless table_rows&.size == 17
      table_rows.lazy.map do |row|
        [
          row.text,
          row.attribute('data-buy').value,
          row.attribute('data-sell').value
        ]
      end
    end
def raw_exchange_rates
      table_rows = Oga.parse_html(response.body).css('#f_box option')
      # CAE porvide 17 currencies on the home page but with header
      # and an empty row in the end
      fail ResponseError, 'Unknown HTML' unless table_rows&.size == 17
      table_rows.lazy.map do |row|
        [
          row.text,
          row.attribute('data-buy').value,
          row.attribute('data-sell').value
        ]
      end
    end
def raw_exchange_rates table_rows = Oga . parse_html ( response . body ) . css ( '#f_box option' ) # CAE porvide 17 currencies on the home page but with header # and an empty row in the end fail ResponseError , 'Unknown HTML' unless table_rows &. size == 17 table_rows . lazy . map do | row | [ row . text , row . attribute ( 'data-buy' ) . value , row . attribute ( 'data-sell' ) . value ] end end
Send the request to the URL and retrun raw data of the response
 @return [Enumerator::Lazy] with the table row in HTML that evaluates to
   [
     ["QAR", "4.7367", "4.9294"],
     ["USD", "17.25", "17.95"]
     ...
   ]
Send the request to the URL and retrun raw data of the response