currencyconversion 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1f1d4f491e70656b3d318aafb32206d79a20b52
4
- data.tar.gz: 1505c844a7bf804c90a85faead45c9f51ed3c695
3
+ metadata.gz: 4b2d7f9ecefcbf39109cc55ee03f3c7576d8d779
4
+ data.tar.gz: 60409d19ba7f1ebcfdfc73d6813db329d098827d
5
5
  SHA512:
6
- metadata.gz: 17fd0b7b3a393485b6149d1c309310e45981388e77c03959bf5fde429302661de60994d3eab64e6d25033188eb18645799e619831437ef7ed6262f4ce37bdec4
7
- data.tar.gz: b0577d35d7c3c6c743c732d1a2e5171129b5afc15024ddffcb1a3022c8977030947a431f8c3fb8af5d77c158fda0bd61ddc04e8cc4d90320fc0ab38d185ba211
6
+ metadata.gz: 205551930ad949e14ae0bb7e4f0a768903bc9aa4dd4ad918d24d99dfdc360af80099119c405f0ada7804534e1451e4a0c0cd53cead6a72bc2d663121a9fdaa49
7
+ data.tar.gz: 38b836900d17f9528a1c6d1cc98ed55ed7caca3ed1188195488fde65e670931d4200fcae4dcb1813ceadc9c01853a2ac44a1fcb9a64421ea14b39f75936590b7
data/README.md CHANGED
@@ -1,41 +1,180 @@
1
- # CurrencyConversion
2
1
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/currency_conversion`. To experiment with that code, run `bin/console` for an interactive prompt.
2
+ [![Travis](https://travis-ci.org/pmoelgaard/currency_conversion.svg)](Travis)
3
+
4
+ # currency_conversion
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ Ruby Library for the currencylayer API, Reliable Exchange Rates & Currency Conversion [the currencylayer API](https://currencylayer.com/).
6
7
 
7
- ## Installation
8
+ ---
8
9
 
10
+ ## Installation
9
11
  Add this line to your application's Gemfile:
10
12
 
11
- ```ruby
13
+ ```
12
14
  gem 'currency_conversion'
15
+
13
16
  ```
14
17
 
15
18
  And then execute:
16
19
 
17
- $ bundle
20
+ ```
21
+ $ bundle
22
+
23
+ ```
18
24
 
19
25
  Or install it yourself as:
20
26
 
21
- $ gem install currency_conversion
27
+ ```
28
+ $ gem install currency_conversion
29
+
30
+ ```
31
+
32
+
33
+ ## Configuration
34
+
35
+ Before using the currencylayer API client you have to setup your account and obtain your API Access Key.
36
+ You can get it by signing up at [https://currencylayer.com/product](https://currencylayer.com/product).
37
+
38
+ ---
39
+
40
+ ## API Overview
41
+ All endpoints in the public API is available through this library.
42
+
43
+ - live
44
+ - list
45
+ - historical
46
+ - convert
47
+ - timeframe
48
+ - change
49
+
50
+ ---
51
+
22
52
 
23
53
  ## Usage
24
54
 
25
- TODO: Write usage instructions here
55
+ The general API is documented here: [https://currencylayer.com/documentation](https://currencylayer.com/documentation).
56
+ You can find parameters, result set definitions and status codes documented here as well.
57
+
58
+
59
+ ### Setup
60
+
61
+ First we require the module
62
+
63
+ ```
64
+ require 'currency_conversion'
65
+
66
+ ```
67
+
68
+ Second we instantiate the client
69
+
70
+ ```
71
+ @client = CurrencyLayer::Client.new( [access_key] )
72
+
73
+ ```
74
+
75
+ #### Optional Parameters
26
76
 
27
- ## Development
77
+ ##### Secure (only available for Basic, Pro and Enterprise accounts)
78
+ Boolean value to indicate if the calls to the API should use a secure protocol or insecure (HTTP/HTTPS). Defaults to false (HTTP, insecure).
28
79
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
80
+ ---
30
81
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
82
+ ## Live
83
+ Takes a simple string and detects the language with a list of detections.
32
84
 
33
- ## Contributing
85
+ ###### Define Query
34
86
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/currency_conversion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
87
+ var liveQuery = {
88
+ source: 'SGD',
89
+ currencies: ['USD', 'THB']
90
+ };
36
91
 
92
+ ###### Simple Request
93
+
94
+ ```ruby
95
+ # Set the currencies to fetch
96
+ currencies = 'AUD,EUR,GBP,PLN'
97
+
98
+ # We declare the options
99
+ options = CurrencyLayer::LiveOptions.new()
100
+
101
+ # We make the call to fetch the live currencies
102
+ response = @client.live(currencies, options)
103
+
104
+ ```
105
+
106
+ ###### Response
107
+ ```
108
+
109
+ {
110
+ "success": true,
111
+ "terms": "https://currencylayer.com/terms",
112
+ "privacy": "https://currencylayer.com/privacy",
113
+ "timestamp": 1455968535,
114
+ "source": "USD",
115
+ "quotes": {
116
+ "USDAUD": 1.39865,
117
+ "USDEUR": 0.898271,
118
+ "USDGBP": 0.694155,
119
+ "USDPLN": 3.927404
120
+ }
121
+ }
122
+
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Example Application
128
+
129
+ In the [rootdir]/example directory there is a fully functional application which runs all requests against all the endpoints in the API, the examples above can be seen there as source code.
130
+
131
+ The example application uses a process.env variable to hold the access key.
132
+
133
+ ---
134
+
135
+ ## Tests
136
+
137
+ The tests are written using the rspec testing library.
138
+ **RSpec** [http://rspec.info/](http://rspec.info/)
139
+
140
+ In order to run the tests, the following environment variables needs to be set:
141
+
142
+ ```
143
+ ACCESS_KEY = [access_key]
144
+
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Customer Support
150
+
151
+ Need any assistance? [Get in touch with Customer Support](mailto:support@apilayer.net?subject=%5Bcurrencylayer%5D).
152
+
153
+ ---
154
+
155
+ ## Updates
156
+ Stay up to date by following [@apilayernet](https://twitter.com/apilayernet) on Twitter.
157
+
158
+ ---
159
+
160
+ ## Legal
161
+
162
+ All usage of the languagelayer website, API, and services is subject to the [languagelayer Terms & Conditions](https://languagelayer.com/terms) and all annexed legal documents and agreements.
163
+
164
+ ---
165
+
166
+ ## Author
167
+ Peter Andreas Moelgaard ([GitHub](https://github.com/pmoelgaard), [Twitter](https://twitter.com/petermoelgaard))
168
+
169
+ ---
37
170
 
38
171
  ## License
172
+ Licensed under the The MIT License (MIT)
173
+
174
+ Copyright (©) 2016 Peter Andreas Moelgaard & apilayer
175
+
176
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
39
177
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
178
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
41
179
 
180
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,3 @@
1
1
  module CurrencyLayer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: currencyconversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Andreas Moelgaard