Class: GetFx::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/getFx.rb

Instance Method Summary collapse

Constructor Details

#initializeValidator

Returns a new instance of Validator.



46
47
48
# File 'lib/getFx.rb', line 46

def initialize()
  @doc = Nokogiri::HTML(open("https://s3.eu-west-2.amazonaws.com/cq-dev-storage/feed.xml"))
end

Instance Method Details

#amtObject



76
77
# File 'lib/getFx.rb', line 76

def amt
end

#currency(value) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/getFx.rb', line 50

def currency(value)
 if value
   r = @doc.at_css("[@currency='" + value + "']")
   if r
return r
   else
      return nil
   end
 else
  return nil
 end
end

#date(value) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/getFx.rb', line 63

def date(value)
 if value
   r = @doc.css("[@time='" + value + "']")
   if r
      return r
   else
      return nil
   end
 else
  return nil
 end
end