forex_quotes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/forex_quotes.rb +32 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4d99842ec3de99b1d784b402016c5d425e65fa4e
4
+ data.tar.gz: 0dd0a36f79fdaaaf147a4aa76a580cfd449ebcb0
5
+ SHA512:
6
+ metadata.gz: 136b8f1fbeca02b999ce00e5b42bfdab8616404cd418ec2a2398d11539a3f82ee6197fe80fe1d79e3f9419067d656423a109df9fc8066ffc3f6ee3010df42fd9
7
+ data.tar.gz: f91b296aece6fb1e6cf30bc12a4e0e5b74d9017ea71ffcd3683afdb85f05cc6512b8a4a02c18c096a040e0026291ec49bb7e5f99108db3c2bf5efc2fced7586f
@@ -0,0 +1,32 @@
1
+ require 'http'
2
+ require 'json'
3
+
4
+ class ForexDataClient
5
+ def initialize(api_key)
6
+ @api_key = api_key
7
+ end
8
+
9
+ def fetch(api_call)
10
+ JSON.parse(HTTP.get("https://forex.1forge.com/1.0.2/" + api_call + "&api_key=" + @api_key))
11
+ end
12
+
13
+ def quota()
14
+ self.fetch('quota?cache=false')
15
+ end
16
+
17
+ def getSymbols()
18
+ self.fetch('symbols?cache=false')
19
+ end
20
+
21
+ def getQuotes(symbols)
22
+ self.fetch('quotes?cache=false&pairs=' + symbols.join(','))
23
+ end
24
+
25
+ def convert(from, to, quantity)
26
+ self.fetch('convert?cache=false&from=' + from + '&to=' + to + '&quantity=' + quantity.to_s)
27
+ end
28
+
29
+ def getMarketStatus()
30
+ self.fetch('market_status?cache=false')
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: forex_quotes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jacob Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Realtime forex quote API client for use with the 1Forge API. To obtain
14
+ a free API key please visit https://1forge.com
15
+ email: contact@1forge.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/forex_quotes.rb
21
+ homepage: https://1forge.com
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.6.11
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Realtime forex quote API client
45
+ test_files: []