Method: TempSMS22#read

Defined in:
lib/tempsms22.rb

#read(number = @number) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/tempsms22.rb', line 35

def read(number=@number)

  url = @url + 'sms/' + number + '/'
  doc = Nokorexi.new(url).to_doc
  table = doc.root.element('//table')

  a = table.xpath('tbody/tr').map do |x|
    x.xpath('td').map {|y| y.plaintext.strip }
  end

  a.map {|x| OpenStruct.new(i(from text date).zip(x).to_h) }

end