Class: GetFx
- Inherits:
-
Object
show all
- Defined in:
- lib/getFx.rb
Defined Under Namespace
Classes: Parser, Validator
Class Method Summary
collapse
Class Method Details
.run(*params) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/getFx.rb', line 5
def self.run(*params)
if params
args = params[0]
else
args = []
end
URI = "https://s3.eu-west-2.amazonaws.com/cq-dev-storage/feed.xml"
valid = Validator.new(URI)
curr = "USD"
if args[0]
curr_f = args[0].upcase
test = valid.currency(curr_f)
unless test.nil?
curr = curr_f
end
end
date = "2017-02-28"
if args[1]
date_f = args[1]
test = valid.date(date_f)
unless test.nil?
curr = curr_f
end
end
amt = 1
if args[2]
amt = args[2]
end
parser = Parser.new(curr, date, amt)
return parser.runCompute
end
|