nordea 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +19 -0
- data/README.md +94 -0
- data/Rakefile +12 -0
- data/lib/nordea.rb +37 -0
- data/lib/nordea/bank.rb +95 -0
- data/lib/nordea/exchange_rates.rb +213 -0
- data/lib/nordea/version.rb +5 -0
- data/nordea.gemspec +29 -0
- data/spec/bank/bank_spec.rb +32 -0
- data/spec/exchange_rates/exchange_rates_spec.rb +76 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/support/sample_currencies.marshal +0 -0
- data/spec/support/sample_data.rb +22 -0
- data/spec/support/sample_electronic.dat +221 -0
- data/spec/support/sample_headers.marshal +0 -0
- metadata +150 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (C) 2011 by Matias Korhonen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
The Nordea Gem
|
2
|
+
==============
|
3
|
+
|
4
|
+
_________________________________
|
5
|
+
< Exchange rates from Nordea Bank >
|
6
|
+
---------------------------------
|
7
|
+
\ ^__^
|
8
|
+
\ (€€)\_______
|
9
|
+
(__)\ )\/\
|
10
|
+
||----w |
|
11
|
+
|| ||
|
12
|
+
|
13
|
+
|
14
|
+
Installation
|
15
|
+
------------
|
16
|
+
|
17
|
+
Just like any other gem:
|
18
|
+
|
19
|
+
gem install nordea
|
20
|
+
|
21
|
+
|
22
|
+
Usage
|
23
|
+
-----
|
24
|
+
|
25
|
+
### With the Money gem
|
26
|
+
|
27
|
+
The Money gem integration works in a similar way to the [eu\_central\_bank](https://github.com/RubyMoney/eu_central_bank) library, mostly because I referenced that gem while building this one. A couple of the methods in the Nordea::Bank class are pretty much identical to those in the eu\_central\_bank gem.
|
28
|
+
|
29
|
+
nordea_bank = Nordea::Bank.new
|
30
|
+
Money.default_bank = nordea_bank
|
31
|
+
|
32
|
+
# Exchange 100 EUR to USD
|
33
|
+
nordea_bank.exchange(100, "EUR", "USD")
|
34
|
+
|
35
|
+
# Exchange 100 USD to South African rands
|
36
|
+
Money.us_dollar(100).exchange_to("ZAR")
|
37
|
+
|
38
|
+
# Exchange 100 Canadian dollars to US dollars
|
39
|
+
nordea_bank.exchange_with(Money.new(100, "CAD"), "USD")
|
40
|
+
|
41
|
+
# Update the forex rates
|
42
|
+
nordea_bank.update_rates
|
43
|
+
|
44
|
+
### Without the Money gem
|
45
|
+
|
46
|
+
exchange_rates = Nordea::ExchangeRates.new
|
47
|
+
|
48
|
+
exchange_rates.currencies
|
49
|
+
#=> returns a hash of currencies
|
50
|
+
|
51
|
+
exchange_rates.currencies(true)
|
52
|
+
#=> returns a hash of currencies, but forces a data update
|
53
|
+
|
54
|
+
exchange_rates.headers
|
55
|
+
#=> returns a hash of the data headers from Nordea
|
56
|
+
|
57
|
+
For more information, read the [documentation](http://rubydoc.info/gems/nordea).
|
58
|
+
|
59
|
+
|
60
|
+
Travis CI Build Status
|
61
|
+
----------------------
|
62
|
+
|
63
|
+
Currently the gem only fully works with Ruby 1.9.2.
|
64
|
+
|
65
|
+
[](http://travis-ci.org/k33l0r/nordea)
|
66
|
+
|
67
|
+
|
68
|
+
About the data and data source
|
69
|
+
------------------------------
|
70
|
+
|
71
|
+
Nordea quotes exchange rates on national banking days at least three times a day:
|
72
|
+
|
73
|
+
* in the morning at 8.00,
|
74
|
+
* at noon at 12.15 and
|
75
|
+
* in the afternoon at 16.15 (approximate times).
|
76
|
+
|
77
|
+
### Useful links:
|
78
|
+
|
79
|
+
* [More information about Nordea exchange rates](http://j.mp/Nordea_exchange_rates)
|
80
|
+
* [More information about the data format](http://j.mp/Rates_for_electronic_processing) [PDF]
|
81
|
+
|
82
|
+
### Disclaimer
|
83
|
+
|
84
|
+
* This is **not** an *official* gem from Nordea.
|
85
|
+
* I have **no affiliation** to any entity connected to Nordea Bank.
|
86
|
+
* I **do not** have any control over the exchange rate data provided, and you use
|
87
|
+
this gem entirely at **your own risk**.
|
88
|
+
|
89
|
+
License
|
90
|
+
-------
|
91
|
+
|
92
|
+
MIT License. Copyright 2011 Matias Korhonen.
|
93
|
+
|
94
|
+
See the LICENSE file for more details.
|
data/Rakefile
ADDED
data/lib/nordea.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require "nordea/bank"
|
2
|
+
require "nordea/exchange_rates"
|
3
|
+
require "nordea/version"
|
4
|
+
|
5
|
+
# Ruby interface to the Nordea Bank exchange rate data.
|
6
|
+
module Nordea
|
7
|
+
# Parses the datetime format used in the Nordea data.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Nordea.parse_time("20150101120056") #=> 2015-01-01 12:00:05 +0200
|
11
|
+
#
|
12
|
+
# @param [String] the datetime string (YYYYMMDDHHmmSS)
|
13
|
+
# @return [Time] the string converted into a Time object
|
14
|
+
def self.parse_time(datetime)
|
15
|
+
Time.new(datetime[0..3].to_i,
|
16
|
+
datetime[4..5].to_i,
|
17
|
+
datetime[6..7].to_i,
|
18
|
+
datetime[8..9].to_i,
|
19
|
+
datetime[10..11].to_i,
|
20
|
+
datetime[11..12].to_i,
|
21
|
+
"+03:00")
|
22
|
+
rescue
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
# Parses the date format used in the Nordea data.
|
27
|
+
#
|
28
|
+
# @param [String] the date string (YYYYMMDD)
|
29
|
+
# @return [Date] the string converted into a Date object
|
30
|
+
def self.parse_date(date)
|
31
|
+
Date.new(date[0..3].to_i,
|
32
|
+
date[4..5].to_i,
|
33
|
+
date[6..7].to_i)
|
34
|
+
rescue
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
end
|
data/lib/nordea/bank.rb
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
require "money"
|
2
|
+
require "nordea/exchange_rates"
|
3
|
+
|
4
|
+
module Nordea
|
5
|
+
# Bank implementation for use with the Money gem.
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# nordea_bank = Nordea::Bank.new
|
9
|
+
# Money.default_bank = nordea_bank
|
10
|
+
# nordea_bank.exchange(100, "EUR", "USD")
|
11
|
+
# Money.us_dollar(100).exchange_to("ZAR")
|
12
|
+
# nordea_bank.exchange_with(Money.new(100, "CAD"), "USD")
|
13
|
+
class Bank < Money::Bank::VariableExchange
|
14
|
+
def initialize
|
15
|
+
super
|
16
|
+
update_rates
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get updated rates from the Nordea server
|
20
|
+
#
|
21
|
+
# Forces an update of the exchange rates
|
22
|
+
#
|
23
|
+
# @return [Hash] rates available
|
24
|
+
def update_rates
|
25
|
+
currencies(true).each_pair do |currency, data|
|
26
|
+
rate = data[:middle_rate_for_commercial_transactions]
|
27
|
+
add_rate("EUR", currency, rate) if known_currencies.include?(currency)
|
28
|
+
end
|
29
|
+
rates
|
30
|
+
end
|
31
|
+
|
32
|
+
# Exchange from one currency to another
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# nordea_bank = Nordea::Bank.new
|
36
|
+
# nordea_bank.exchange(100, "EUR", "USD")
|
37
|
+
#
|
38
|
+
# @param [Integer] cents the amount for the conversion in cents, or equivalent
|
39
|
+
# @param [String] from_currency the source currency
|
40
|
+
# @param [String] to_currency the target currency
|
41
|
+
# @return [Money] the result of the conversion
|
42
|
+
def exchange(cents, from_currency = "EUR", to_currency = "EUR")
|
43
|
+
exchange_with(Money.new(cents, from_currency), to_currency)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Exchanges the given +Money+ object to a new +Money+ object in
|
47
|
+
# +to_currency+.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# nordea_bank = Nordea::Bank.new
|
51
|
+
# nordea_bank.exchange_with(Money.new(100, "CAD"), "USD")
|
52
|
+
#
|
53
|
+
# @param [Money] from the Money object from which to convert
|
54
|
+
# @param [String] to_currency the ISO code for the target currency
|
55
|
+
# @return [Money] the new Money object in the target currency
|
56
|
+
def exchange_with(from, to_currency)
|
57
|
+
rate = get_rate(from.currency, to_currency)
|
58
|
+
unless rate
|
59
|
+
from_base_rate = get_rate("EUR", from.currency)
|
60
|
+
to_base_rate = get_rate("EUR", to_currency)
|
61
|
+
rate = to_base_rate / from_base_rate
|
62
|
+
end
|
63
|
+
Money.new((from.cents * rate).round, to_currency)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initialize or use an existing Nordea::ExchangeRates object
|
67
|
+
#
|
68
|
+
# @return [ExchangeRates] an instance of Nordea::ExchangeRates
|
69
|
+
def exchange_rates
|
70
|
+
@exchange_rates ||= Nordea::ExchangeRates.new
|
71
|
+
end
|
72
|
+
|
73
|
+
# Get the currency data from Nordea
|
74
|
+
#
|
75
|
+
# @param [Boolean] force force an update of the currency data
|
76
|
+
# @return [Hash] Data for all the currencies and rates from Nordea
|
77
|
+
def currencies(force = false)
|
78
|
+
exchange_rates.currencies(force)
|
79
|
+
end
|
80
|
+
|
81
|
+
# List all currencies known to the money gem
|
82
|
+
#
|
83
|
+
# @return [Array<String>] ISO currency codes
|
84
|
+
def money_currencies
|
85
|
+
Money::Currency::TABLE.keys.map { |c| c.to_s.upcase }
|
86
|
+
end
|
87
|
+
|
88
|
+
# List currencies found in the Money gem *and* the Nordea currency data
|
89
|
+
#
|
90
|
+
# @return [Array<String>] ISO currency codes
|
91
|
+
def known_currencies
|
92
|
+
@known_currencies = money_currencies & exchange_rates.currencies.keys
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,213 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require "net/http"
|
3
|
+
require "uri"
|
4
|
+
require "time"
|
5
|
+
require "date"
|
6
|
+
|
7
|
+
module Nordea
|
8
|
+
# Fetch and update Excahnge rates from Nordea Bank.
|
9
|
+
#
|
10
|
+
# Parses the custom dataformat used by Nordea into more useful Ruby types and
|
11
|
+
# objects.
|
12
|
+
class ExchangeRates
|
13
|
+
# URI to the machine readable data file.
|
14
|
+
DATA_URI = URI::HTTP.build({
|
15
|
+
:host => "service.nordea.com",
|
16
|
+
:path => "/nordea-openpages/fi/lists/currency/elelctronicExchangeFI.dat"
|
17
|
+
})
|
18
|
+
|
19
|
+
# Hash keys for key-value pairs that should be converted into floats.
|
20
|
+
FLOAT_KEYS = [
|
21
|
+
:middle_rate_for_commercial_transactions,
|
22
|
+
:buying_rate_for_commercial_transactions,
|
23
|
+
:selling_rate_for_commercial_transactions,
|
24
|
+
:buying_rate_for_cash,
|
25
|
+
:selling_rate_for_cash
|
26
|
+
]
|
27
|
+
|
28
|
+
# Initialize a new Nordea::ExchangeRates object.
|
29
|
+
def initialize
|
30
|
+
end
|
31
|
+
|
32
|
+
# The batch headers
|
33
|
+
#
|
34
|
+
# @return [Hash] key-value pairs
|
35
|
+
# @param [Boolean] force force update
|
36
|
+
def headers(force = false)
|
37
|
+
header_line = lines(force).first
|
38
|
+
|
39
|
+
headers = {
|
40
|
+
:file_id => header_line[0..3], # File ID = VK01
|
41
|
+
:record_id => header_line[4..6], # Record ID = 000
|
42
|
+
:change_time => header_line[7..20], # Exchange rate change time
|
43
|
+
:notifications => header_line[21..140], # Notifications
|
44
|
+
:reserved => header_line[141..149] # Reserved
|
45
|
+
}
|
46
|
+
|
47
|
+
headers[:change_time] = Nordea.parse_time(headers[:change_time])
|
48
|
+
headers[:notifications].strip! if headers[:notifications].respond_to? :strip!
|
49
|
+
headers[:reserved].strip! if headers[:reserved].respond_to? :strip!
|
50
|
+
headers
|
51
|
+
end
|
52
|
+
|
53
|
+
# List all currencies as a hash. Uses the currencies' ISO codes as keys.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# e = Nordea::ExchangeRates.new #=> #<Nordea::ExchangeRates:0x00000102102888>
|
57
|
+
# e.currencies["USD"] #=> {
|
58
|
+
# # :file_id => "VK01",
|
59
|
+
# # :record_id => "001",
|
60
|
+
# # :quotation_time => 2011-06-17 15:50:01 +0300,
|
61
|
+
# # :rate_type => :list,
|
62
|
+
# # :currency_iso_code => "USD",
|
63
|
+
# # :counter_currency_iso_code => "EUR",
|
64
|
+
# # :middle_rate_for_commercial_transactions => 1.427,
|
65
|
+
# # :buying_rate_for_commercial_transactions => 1.442,
|
66
|
+
# # :selling_rate_for_commercial_transactions => 1.412,
|
67
|
+
# # :buying_rate_for_cash => 1.459,
|
68
|
+
# # :selling_rate_for_cash => 1.395,
|
69
|
+
# # :direction_of_change => "-",
|
70
|
+
# # :currency_convertability => true,
|
71
|
+
# # :euro_area => false,
|
72
|
+
# # :euro_adoption_date => nil,
|
73
|
+
# # :currency_expiry => false,
|
74
|
+
# # :reserved => ""
|
75
|
+
# # }
|
76
|
+
#
|
77
|
+
# @param [Boolean] force force update
|
78
|
+
# @return [Hash] a hash off all list currency rates and their properties
|
79
|
+
def currencies(force = false)
|
80
|
+
hash = {}
|
81
|
+
|
82
|
+
records_array(force).each do |record|
|
83
|
+
hash[record[:currency_iso_code]] = record
|
84
|
+
end
|
85
|
+
|
86
|
+
hash
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
# Fetches the latest machine readable currency data from the Nordea server.
|
92
|
+
#
|
93
|
+
# Nordea quotes exchange rates on national banking days at least three times a day:
|
94
|
+
# * in the morning at 8.00,
|
95
|
+
# * at noon at 12.15 and
|
96
|
+
# * in the afternoon at 16.15 (approximate times).
|
97
|
+
#
|
98
|
+
# @see http://j.mp/Nordea_exchange_rates More information about Nordea exchange rates
|
99
|
+
# @see http://j.mp/Rates_for_electronic_processing More information about the data format
|
100
|
+
#
|
101
|
+
# @return [String] the raw data string.
|
102
|
+
def fetch_data
|
103
|
+
res = Net::HTTP.start(DATA_URI.host, DATA_URI.port) do |http|
|
104
|
+
http.get(DATA_URI.path, { "USER_AGENT" => "Nordea::Bank gem" })
|
105
|
+
end
|
106
|
+
|
107
|
+
if res.code =~ /2\d\d/
|
108
|
+
res.body
|
109
|
+
else
|
110
|
+
raise ServerError, "The server did not respond in the manner in which we are accustomed to."
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# The raw machine readable data split into lines.
|
115
|
+
#
|
116
|
+
# @return [Array<String>] the raw data split into lines
|
117
|
+
# @param [Boolean] force force update
|
118
|
+
# @see #raw_data
|
119
|
+
def lines(force = false)
|
120
|
+
raw_data(force).lines.to_a
|
121
|
+
end
|
122
|
+
|
123
|
+
# The raw machine readable data from Nordea.
|
124
|
+
#
|
125
|
+
# If the data has already been fetched, it will return it. If not, a call
|
126
|
+
# will be made to the Nordea server.
|
127
|
+
#
|
128
|
+
# @param [Boolean] force force update
|
129
|
+
# @return [String] the raw data string
|
130
|
+
# @see #fetch_data
|
131
|
+
def raw_data(force = false)
|
132
|
+
if force
|
133
|
+
@raw_data = fetch_data
|
134
|
+
else
|
135
|
+
@raw_data ||= fetch_data
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# The data entries as an array of hashes with minimal processing.
|
140
|
+
#
|
141
|
+
# @return [Array<Hash>] Array of exchange rate records
|
142
|
+
# @param [Boolean] force force update
|
143
|
+
def records_array(force = false)
|
144
|
+
all = lines(force)[1..(lines.length - 1)].map do |line|
|
145
|
+
hash = {
|
146
|
+
:file_id => line[0..3], # File ID (= VK01)
|
147
|
+
:record_id => line[4..6], # Record ID (= 000)
|
148
|
+
:quotation_time => line[7..20], # Quotation date
|
149
|
+
:rate_type => line[21..24], # Rate type ( 0001 = list, 0002 = valuation)
|
150
|
+
:currency_iso_code => line[25..27], # Currency ISO code
|
151
|
+
:counter_currency_iso_code => line[28..30], # Counter currency ISO code (= EUR)
|
152
|
+
:middle_rate_for_commercial_transactions => line[31..43], # Middle rate for commercial transactions
|
153
|
+
:buying_rate_for_commercial_transactions => line[44..56], # Buying rate for commercial transactions
|
154
|
+
:selling_rate_for_commercial_transactions => line[57..69], # Selling rate for commercial transactions
|
155
|
+
:buying_rate_for_cash => line[70..82], # Buying rate for cash
|
156
|
+
:selling_rate_for_cash => line[83..95], # Selling rate for cash
|
157
|
+
:direction_of_change => line[96..96], # Direction of change from previous value ("+", "-" or blank)
|
158
|
+
:currency_convertability => line[97..97], # K = convertible, E = non-convertible
|
159
|
+
:euro_area => line[98..98], # 1 = euro area currency, 0 = non-euro area currency
|
160
|
+
:euro_adoption_date => line[99..99], # Euro adoption date
|
161
|
+
:currency_expiry => line[100..107], # K = in use, E = not in use
|
162
|
+
:reserved => line[108..149] # Reserved
|
163
|
+
}
|
164
|
+
|
165
|
+
line_postprocess(hash)
|
166
|
+
end
|
167
|
+
|
168
|
+
list_rates = all.select do |rate|
|
169
|
+
rate[:rate_type] == :list
|
170
|
+
end
|
171
|
+
|
172
|
+
list_rates
|
173
|
+
end
|
174
|
+
|
175
|
+
# Converts the string values from the Nordea data into Ruby objects where
|
176
|
+
# possible.
|
177
|
+
#
|
178
|
+
# @param [Hash] line a line from the data as a Hash
|
179
|
+
# @return [Hash] the same line with some values converted into the
|
180
|
+
# expected formats
|
181
|
+
def line_postprocess(line)
|
182
|
+
line[:quotation_time] = Nordea.parse_time(line[:quotation_time])
|
183
|
+
line[:reserved].strip! if line[:reserved].respond_to? :strip!
|
184
|
+
line[:rate_type] = if line[:rate_type] == "0001"
|
185
|
+
:list
|
186
|
+
elsif line[:rate_type] == "0002"
|
187
|
+
:valuation
|
188
|
+
end
|
189
|
+
|
190
|
+
line[:euro_area] = (line[:euro_area] == "1") ? true : false
|
191
|
+
|
192
|
+
if line[:euro_area]
|
193
|
+
line[:euro_adoption_date] = Nordea.parse_date(line[:euro_adoption_date])
|
194
|
+
else
|
195
|
+
line[:euro_adoption_date] = nil
|
196
|
+
end
|
197
|
+
|
198
|
+
line[:currency_expiry] = (line[:currency_expiry] == "K") ? true : false
|
199
|
+
line[:currency_convertability] = (line[:currency_convertability] == "K") ? true : false
|
200
|
+
|
201
|
+
FLOAT_KEYS.each do |key|
|
202
|
+
str = line[key]
|
203
|
+
float = "#{str[0,6]}.#{str[6,7]}".to_f
|
204
|
+
line[key] = float
|
205
|
+
end
|
206
|
+
|
207
|
+
line
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# The exception that's raised if the server doesn't respond correctly.
|
212
|
+
class ServerError < StandardError; end
|
213
|
+
end
|
data/nordea.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "nordea/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "nordea"
|
7
|
+
s.version = Nordea::VERSION
|
8
|
+
s.authors = ["Matias Korhonen"]
|
9
|
+
s.email = ["matias@kiskolabs.com"]
|
10
|
+
s.homepage = "http://github.com/k33l0r/nordea"
|
11
|
+
s.summary = %q{Exchange rates from Nordea Bank}
|
12
|
+
s.description = %q{A Money.gem compatible currency exchange rate implementation for Nordea Bank}
|
13
|
+
|
14
|
+
s.rubyforge_project = "nordea"
|
15
|
+
|
16
|
+
s.add_dependency "money", "~> 3.7.1"
|
17
|
+
|
18
|
+
s.add_development_dependency "yard"
|
19
|
+
s.add_development_dependency "rspec"
|
20
|
+
s.add_development_dependency "webmock"
|
21
|
+
s.add_development_dependency "awesome_print"
|
22
|
+
s.add_development_dependency "simplecov"
|
23
|
+
s.add_development_dependency "rake", "~> 0.9.2"
|
24
|
+
|
25
|
+
s.files = `git ls-files`.split("\n")
|
26
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
28
|
+
s.require_paths = ["lib"]
|
29
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Nordea::Bank" do
|
4
|
+
before(:each) do
|
5
|
+
stub_request(:get, "http://service.nordea.com/nordea-openpages/fi/lists/currency/elelctronicExchangeFI.dat").
|
6
|
+
to_return(:status => 200, :body => SampleData.raw)
|
7
|
+
@bank = Nordea::Bank.new
|
8
|
+
Money.default_bank = @bank
|
9
|
+
end
|
10
|
+
|
11
|
+
context "#exchange" do
|
12
|
+
it "returns the correct exchange rates" do
|
13
|
+
@bank.known_currencies.each do |currency|
|
14
|
+
@bank.exchange(100, "EUR", currency).cents.should == (SampleData.get_rate(currency) * 100).round
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context "#exchange_with" do
|
20
|
+
it "returns the correct exchange rates" do
|
21
|
+
@bank.known_currencies.each do |currency|
|
22
|
+
@bank.exchange_with(Money.new(100, "EUR"), currency).cents.should == (SampleData.get_rate(currency) * 100).round
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "#exchange_rates" do
|
28
|
+
it "is an instance of Nordea::ExchangeRates" do
|
29
|
+
@bank.exchange_rates.should be_an_instance_of(Nordea::ExchangeRates)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Nordea::ExchangeRates" do
|
4
|
+
before(:each) do
|
5
|
+
stub_request(:get, "http://service.nordea.com/nordea-openpages/fi/lists/currency/elelctronicExchangeFI.dat").
|
6
|
+
to_return(:status => 200, :body => SampleData.raw)
|
7
|
+
@exchange_rates = Nordea::ExchangeRates.new
|
8
|
+
end
|
9
|
+
|
10
|
+
context "#lines" do
|
11
|
+
it "returns the raw data as an array of lines" do
|
12
|
+
@exchange_rates.send(:lines).should be_kind_of(Array)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "returns the correct number of lines" do
|
16
|
+
@exchange_rates.send(:lines).count.should == 221
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "#records_array" do
|
21
|
+
before(:each) do
|
22
|
+
@records = @exchange_rates.send(:records_array)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "returns an array of hashes" do
|
26
|
+
@records.should be_kind_of(Array)
|
27
|
+
@records.each do |record|
|
28
|
+
record.should be_kind_of(Hash)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it "has the correct number of records" do
|
33
|
+
@records.length.should == SampleData.currencies.length
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has the correct data" do
|
37
|
+
@records.each do |record|
|
38
|
+
currency = record[:currency_iso_code]
|
39
|
+
sample = SampleData.currencies[currency]
|
40
|
+
|
41
|
+
record.each_pair do |key, value|
|
42
|
+
value.should == sample[key]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "#headers" do
|
49
|
+
before(:each) do
|
50
|
+
@headers = @exchange_rates.headers
|
51
|
+
end
|
52
|
+
|
53
|
+
it "returns a hash" do
|
54
|
+
@headers.should be_kind_of(Hash)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "has the correct data" do
|
58
|
+
@headers = @exchange_rates.headers
|
59
|
+
@headers.each_pair do |key,value|
|
60
|
+
value.should == SampleData.headers[key]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "#fetch_data" do
|
66
|
+
it "returns the raw data from the server if the request is successful" do
|
67
|
+
@exchange_rates.send(:fetch_data).should == SampleData.raw.read
|
68
|
+
end
|
69
|
+
|
70
|
+
it "raises an exception if the request is not successful" do
|
71
|
+
stub_request(:get, "http://service.nordea.com/nordea-openpages/fi/lists/currency/elelctronicExchangeFI.dat").
|
72
|
+
to_return(:status => 404, :body => SampleData.raw)
|
73
|
+
expect { @exchange_rates.send(:fetch_data) }.to raise_error Nordea::ServerError
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require "simplecov"
|
2
|
+
SimpleCov.start
|
3
|
+
|
4
|
+
require "nordea"
|
5
|
+
require "webmock/rspec"
|
6
|
+
|
7
|
+
# Load support files
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
# Remove this line if you don't want RSpec's should and should_not
|
12
|
+
# methods or matchers
|
13
|
+
require 'rspec/expectations'
|
14
|
+
config.include RSpec::Matchers
|
15
|
+
|
16
|
+
# == Mock Framework
|
17
|
+
config.mock_with :rspec
|
18
|
+
end
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module SampleData
|
4
|
+
CURRENCIES = Marshal.load(File.open(File.expand_path("../sample_currencies.marshal", __FILE__), "r"))
|
5
|
+
HEADERS = Marshal.load(File.open(File.expand_path("../sample_headers.marshal", __FILE__), "r"))
|
6
|
+
|
7
|
+
def self.raw
|
8
|
+
File.open(File.expand_path("../sample_electronic.dat", __FILE__), "r")
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.currencies
|
12
|
+
CURRENCIES
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.get_rate(currency)
|
16
|
+
CURRENCIES[currency][:middle_rate_for_commercial_transactions]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.headers
|
20
|
+
HEADERS
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,221 @@
|
|
1
|
+
VK0100020110614154727Listakurssit alle 40.000 eur maksuille 14.06.11 15:47
|
2
|
+
VK01001199901010730000001EUREUR00000100000000000010000000000001000000000000100000000000010000000+K000000000K
|
3
|
+
VK01001201106141547190001USDEUR00000144480000000014598000000001429800000000147680000000014128000-K000000000K
|
4
|
+
VK01001201106141547140001JPYEUR00011591000000001179100000000113910000000012001000000001118100000-K000000000K
|
5
|
+
VK01001201106141547190001GBPEUR00000088100000000008910000000000871000000000090100000000008610000-K000000000K
|
6
|
+
VK01001201106141547190001SEKEUR00000911830000000092183000000009018300000000932330000000089133000+K000000000K
|
7
|
+
VK01001201106141547170001NOKEUR00000779650000000078965000000007696500000000797650000000076165000-K000000000K
|
8
|
+
VK01001201106141547130001DKKEUR00000745900000000074915000000007426500000000761700000000073010000+K000000000K
|
9
|
+
VK01001201106141547150001CHFEUR00000121160000000012241000000001199100000000124160000000011816000-K000000000K
|
10
|
+
VK01001201101011123110001EEKEUR00001564660000000156466000000015646600000001564660000000156466000+K120110101E
|
11
|
+
VK01001201106141547140001LVLEUR00000070860000000007185000000000698700000000073060000000006866000-K000000000K
|
12
|
+
VK01001201106141547130001LTLEUR00000345280000000034768000000003428800000000356280000000033428000+K000000000K
|
13
|
+
VK01001201106141547170001CADEUR00000140740000000014224000000001392400000000144040000000013744000-K000000000K
|
14
|
+
VK01001201106141547150001HKDEUR00001124560000000114556000000011035600000001168560000000106656000-K000000000K
|
15
|
+
VK01001201106141547190001AUDEUR00000135730000000013773000000001337300000000141730000000012973000+K000000000K
|
16
|
+
VK01001201106141547160001NZDEUR00000176630000000017828000000001749800000000183630000000016563000+K000000000K
|
17
|
+
VK01001201106141547120001ZAREUR00000975400000000100340000000009474000000001015400000000092240000-K000000000K
|
18
|
+
VK01001200801011056450001MTLEUR00000042930000000004293000000000429300000000042930000000004293000-K120080101E
|
19
|
+
VK01001201106141547150001SAREUR00000541945000000054914500000005347450000000568945000000051444500-K000000000K
|
20
|
+
VK01001201106141547120001MADEUR00001133760000000116626000000011012600000000000000000000000000000-K000000000K
|
21
|
+
VK01001201106141547170001KWDEUR00000039635000000004013500000000391350000000000000000000000000000-K000000000K
|
22
|
+
VK01001201106141547120001AEDEUR00000530825000000053592500000005257250000000557025000000050232500-K000000000K
|
23
|
+
VK01001201106141547170001SGDEUR00000178040000000018104000000001750400000000185240000000016934000+K000000000K
|
24
|
+
VK01001201106141547140001MYREUR00000437920000000000000000000000000000000000000000000000000000000-K000000000K
|
25
|
+
VK01001201106141547170001INREUR00006463700000000686370000000060637000000000000000000000000000000-K000000000K
|
26
|
+
VK01001200801011056420001CYPEUR00000058527400000005852740000000585274000000058527400000005852740+K120080101E
|
27
|
+
VK01001201106141547150001RUBEUR00004028880000000427888000000037788800000004338880000000367888000-K000000000K
|
28
|
+
VK01001201106141547170001CZKEUR00002411800000000244780000000023758000000002516800000000230680000+K000000000K
|
29
|
+
VK01001200901010000010001SKKEUR00003012600000000301260000000030126000000000000000000000000000000+K120090101E
|
30
|
+
VK01001201106141547120001PLNEUR00000393020000000040302000000003830200000000410020000000037602000-K000000000K
|
31
|
+
VK01001201106141547140001HUFEUR00026451000000002685100000000260510000000027396000000002539600000-K000000000K
|
32
|
+
VK01001201106141547160001THBEUR00004400900000000450090000000043009000000004650900000000415090000+K000000000K
|
33
|
+
VK01001201106141547170001KRWEUR00156404000000015910400000001537040000000163604000000014650400000-K000000000K
|
34
|
+
VK01001201106141547150001TNDEUR00000197894300000019889430000001968943000000000000000000000000000-K000000000K
|
35
|
+
VK01001201106141547160001XAUEUR00000009515700000001061570000000084157000000000000000000000000000+K000000000K
|
36
|
+
VK01001201106141547150001XYPEUR00000487530000000048883000000004862300000000000000000000000000000-K000000000K
|
37
|
+
VK01001201106141547140001UBFEUR00000474550000000047585000000004732500000000000000000000000000000-K000000000K
|
38
|
+
VK01001201106141547140001KOREUR00000533010000000053461000000005314100000000000000000000000000000-K000000000K
|
39
|
+
VK01001201106141547190001KOXEUR00000465990000000046749000000004644900000000000000000000000000000-K000000000K
|
40
|
+
VK01001201106141547170001XDREUR00000089430000000008953000000000893300000000000000000000000000000-K000000000K
|
41
|
+
VK01001199901011114430001FIMEUR00000594573000000059457300000005945730000000594573000000059457300 K119990101E
|
42
|
+
VK01001199901011114430001DEMEUR00000195583000000019558300000001955830000000195583000000019558300+K119990101E
|
43
|
+
VK01001199901011114430001FRFEUR00000655957000000065595700000006559570000000655957000000065595700+K119990101E
|
44
|
+
VK01001199901011114440001NLGEUR00000220371000000022037100000002203710000000220371000000022037100+K119990101E
|
45
|
+
VK01001199901011114440001ITLEUR00193627000000019362700000001936270000000193627000000019362700000+K119990101E
|
46
|
+
VK01001199901011114440001ATSEUR00001376030000000137603000000013760300000001376030000000137603000+K119990101E
|
47
|
+
VK01001199901011114440001ESPEUR00016638600000001663860000000166386000000016638600000001663860000+K119990101E
|
48
|
+
VK01001199901011114440001IEPEUR00000078756400000007875640000000787564000000078756400000007875640+K119990101E
|
49
|
+
VK01001199901011114450001BEFEUR00004033990000000403399000000040339900000004033990000000403399000+K119990101E
|
50
|
+
VK01001199901011114450001LUFEUR00004033990000000403399000000040339900000004033990000000403399000+K119990101E
|
51
|
+
VK01001199901011114450001PTEEUR00020048200000002004820000000200482000000020048200000002004820000+K119990101E
|
52
|
+
VK01001200012300915000001GRDEUR00034075000000003407500000000340750000000034075000000003407500000-K120010101E
|
53
|
+
VK01001201106141553270001ALLEUR00014230000000001423000000000142300000000000000000000000000000000-E000000000K
|
54
|
+
VK01001201106141553260001ANGEUR00000252840000000025284000000002528400000000000000000000000000000+E000000000K
|
55
|
+
VK01001201106141553270001ARSEUR00000591000000000059100000000005910000000000000000000000000000000+E000000000K
|
56
|
+
VK01001201106141553270001AWGEUR00000257170000000025717000000002571700000000000000000000000000000+E000000000K
|
57
|
+
VK01001201106141553270001BBDEUR00000287520000000028752000000002875200000000000000000000000000000+E000000000K
|
58
|
+
VK01001201106141553270001BDTEUR00010677070000001067707000000106770700000000000000000000000000000+E000000000K
|
59
|
+
VK01001201106141547160001BGNEUR00000195580000000020058000000001905800000000203580000000018758000+K000000000K
|
60
|
+
VK01001201106141553270001BHDEUR00000054470000000005447000000000544700000000000000000000000000000+E000000000K
|
61
|
+
VK01001201106141553270001BIFEUR00174820800000017482080000001748208000000000000000000000000000000+E000000000K
|
62
|
+
VK01001201106141553270001BMDEUR00000144480000000014448000000001444800000000000000000000000000000+E000000000K
|
63
|
+
VK01001201106141553270001BNDEUR00000177970000000017797000000001779700000000000000000000000000000+E000000000K
|
64
|
+
VK01001201106141553270001BOBEUR00001005580000000100558000000010055800000000000000000000000000000+E000000000K
|
65
|
+
VK01001201106141553270001BAMEUR00000195470000000019547000000001954700000000000000000000000000000+E000000000K
|
66
|
+
VK01001201106141553270001BRLEUR00000228710000000022871000000002287100000000242200000000021580000+E000000000K
|
67
|
+
VK01001201106141553270001BSDEUR00000144480000000014448000000001444800000000000000000000000000000+E000000000K
|
68
|
+
VK01001201106141553270001BTNEUR00006462590000000646259000000064625900000000000000000000000000000+E000000000K
|
69
|
+
VK01001201106141553270001BWPEUR00000938180000000093818000000009381800000000000000000000000000000+E000000000K
|
70
|
+
VK01001201106141553270001BZDEUR00000281520000000028152000000002815200000000000000000000000000000+E000000000K
|
71
|
+
VK01001201106141553270001CLPEUR00067313230000006731323000000673132300000000000000000000000000000+E000000000K
|
72
|
+
VK01001201106141553270001CNYEUR00000936090000000093609000000009360900000000982130000000089213000+E000000000K
|
73
|
+
VK01001201106141553270001CNHEUR00000935360000000093536000000009353600000000000000000000000000000+E000000000K
|
74
|
+
VK01001201106141553270001COPEUR00256654270000025665427000002566542700000000000000000000000000000+E000000000K
|
75
|
+
VK01001201106141553270001CRCEUR00072630100000007263010000000726301000000000000000000000000000000+E000000000K
|
76
|
+
VK01001201106141553260001CUPEUR00000145390000000014539000000001453900000000000000000000000000000-E000000000K
|
77
|
+
VK01001201106141553270001CVEEUR00011031050000001103105000000110310500000000000000000000000000000+E000000000K
|
78
|
+
VK01001201106141553270001DJFEUR00025262330000002526233000000252623300000000000000000000000000000+E000000000K
|
79
|
+
VK01001201106141553270001DOPEUR00005432450000000543245000000054324500000000000000000000000000000+E000000000K
|
80
|
+
VK01001201106141553270001DZDEUR00010344320000001034432000000103443200000000000000000000000000000+E000000000K
|
81
|
+
VK01001201106141553270001EGPEUR00000858570000000085857000000008585700000000000000000000000000000+E000000000K
|
82
|
+
VK01001201106141553270001ETBEUR00002436940000000243694000000024369400000000000000000000000000000+E000000000K
|
83
|
+
VK01001201106141553270001FJDEUR00000251840000000025184000000002518400000000000000000000000000000+E000000000K
|
84
|
+
VK01001201106141553270001GHSEUR00000218810000000021881000000002188100000000000000000000000000000+E000000000K
|
85
|
+
VK01001201106141553270001GIPEUR00000237080000000023708000000002370800000000000000000000000000000+E000000000K
|
86
|
+
VK01001201106141553270001GMDEUR00003835940000000383594000000038359400000000000000000000000000000-E000000000K
|
87
|
+
VK01001201106141553270001GNFEUR00958624800000095862480000009586248000000000000000000000000000000+E000000000K
|
88
|
+
VK01001201106141553270001GTQEUR00001126370000000112637000000011263700000000000000000000000000000+E000000000K
|
89
|
+
VK01001201106141553270001GYDEUR00029400240000002940024000000294002400000000000000000000000000000+E000000000K
|
90
|
+
VK01001201106141553270001HNLEUR00002729950000000272995000000027299500000000000000000000000000000+E000000000K
|
91
|
+
VK01001201106141553270001HTGEUR00005829770000000582977000000058297700000000000000000000000000000+E000000000K
|
92
|
+
VK01001201106141547160001HRKEUR00000739950000000075995000000007199500000000763750000000071555000+K000000000K
|
93
|
+
VK01001201106141553270001IDREUR01233384000000123338400000012333840000000000000000000000000000000+E000000000K
|
94
|
+
VK01001201106141553270001ILSEUR00000490610000000049061000000004906100000000000000000000000000000-E000000000K
|
95
|
+
VK01001201106141553270001IQDEUR00168319200000016831920000001683192000000000000000000000000000000+E000000000K
|
96
|
+
VK01001201106141553270001IRREUR01676979360000167697936000016769793600000000000000000000000000000-E000000000K
|
97
|
+
VK01001201106141553270001JMDEUR00012244680000001224468000000122446800000000000000000000000000000+E000000000K
|
98
|
+
VK01001201106141553270001JODEUR00000102290000000010229000000001022900000000000000000000000000000+E000000000K
|
99
|
+
VK01001201106141553270001KESEUR00012909290000001290929000000129092900000000000000000000000000000+E000000000K
|
100
|
+
VK01001201106141553270001KHREUR00591645600000059164560000005916456000000000000000000000000000000+E000000000K
|
101
|
+
VK01001201106141553260001KMFEUR00049484400000004948440000000494844000000000000000000000000000000+E000000000K
|
102
|
+
VK01001201106141553270001KPWEUR00018782400000001878240000000187824000000000000000000000000000000+E000000000K
|
103
|
+
VK01001201106141553270001KYDEUR00000117030000000011703000000001170300000000000000000000000000000+E000000000K
|
104
|
+
VK01001201106141553260001LAKEUR01157140320000115714032000011571403200000000000000000000000000000+E000000000K
|
105
|
+
VK01001201106141553270001LBPEUR00216864480000021686448000002168644800000000000000000000000000000+E000000000K
|
106
|
+
VK01001201106141553260001LKREUR00015820560000001582056000000158205600000000000000000000000000000+E000000000K
|
107
|
+
VK01001201106141553270001LRDEUR00010402560000001040256000000104025600000000000000000000000000000+E000000000K
|
108
|
+
VK01001201106141553260001LSLEUR00000971630000000097163000000009716300000000000000000000000000000+E000000000K
|
109
|
+
VK01001201106141553270001LYDEUR00000173000000000017300000000001730000000000000000000000000000000+E000000000K
|
110
|
+
VK01001201106141553270001MMKEUR00000926120000000092612000000009261200000000000000000000000000000+E000000000K
|
111
|
+
VK01001201106141553270001MNTEUR00179155200000017915520000001791552000000000000000000000000000000+E000000000K
|
112
|
+
VK01001201106141553270001MOPEUR00001157000000000115700000000011570000000000000000000000000000000+E000000000K
|
113
|
+
VK01001201106141553270001MROEUR00039493610000003949361000000394936100000000000000000000000000000+E000000000K
|
114
|
+
VK01001201106141553270001MUREUR00003973200000000397320000000039732000000000000000000000000000000+E000000000K
|
115
|
+
VK01001201106141553270001MVREUR00002175870000000217587000000021758700000000000000000000000000000+E000000000K
|
116
|
+
VK01001201106141553260001MWKEUR00021672000000002167200000000216720000000000000000000000000000000+E000000000K
|
117
|
+
VK01001201106141547120001MXNEUR00001710140000000179014000000016301400000001786140000000159114000-K000000000K
|
118
|
+
VK01001201106141553270001MZNEUR00004045440000000404544000000040454400000000000000000000000000000-E000000000K
|
119
|
+
VK01001201106141553270001NADEUR00000975620000000097562000000009756200000000000000000000000000000+E000000000K
|
120
|
+
VK01001201106141553270001NGNEUR00022637130000002263713000000226371300000000000000000000000000000+E000000000K
|
121
|
+
VK01001201106141553270001NIOEUR00003231660000000323166000000032316600000000000000000000000000000+E000000000K
|
122
|
+
VK01001201106141553270001NPREUR00010343320000001034332000000103433200000000000000000000000000000+E000000000K
|
123
|
+
VK01001201106141553270001OMREUR00000055620000000005562000000000556200000000000000000000000000000+E000000000K
|
124
|
+
VK01001201106141553270001PABEUR00000144480000000014448000000001444800000000000000000000000000000+E000000000K
|
125
|
+
VK01001201106141553270001PENEUR00000399050000000039905000000003990500000000000000000000000000000+E000000000K
|
126
|
+
VK01001201106141553270001PGKEUR00000314020000000031402000000003140200000000000000000000000000000-E000000000K
|
127
|
+
VK01001201106141553270001PHPEUR00006249900000000624990000000062499000000000000000000000000000000+E000000000K
|
128
|
+
VK01001201106141553270001PKREUR00012389160000001238916000000123891600000000000000000000000000000+E000000000K
|
129
|
+
VK01001201106141553270001PYGEUR00573585600000057358560000005735856000000000000000000000000000000+E000000000K
|
130
|
+
VK01001201106141553270001QAREUR00000526070000000052607000000005260700000000000000000000000000000+E000000000K
|
131
|
+
VK01001201106141547160001RONEUR00000417250000000042725000000004072500000000000000000000000000000-K000000000K
|
132
|
+
VK01001201106141553260001SBDEUR00000985540000000098554000000009855400000000000000000000000000000-E000000000K
|
133
|
+
VK01001201106141547130001RSDEUR00010025500000001042550000000096255000000000000000000000000000000+K000000000K
|
134
|
+
VK01001201106141553270001SCREUR00001737700000000173770000000017377000000000000000000000000000000+E000000000K
|
135
|
+
VK01001201106141553260001SDGEUR00000385790000000038579000000003857900000000000000000000000000000+E000000000K
|
136
|
+
VK01001200701021605380001SITEUR00023964000000002396400000000239640000000000000000000000000000000-K120070101E
|
137
|
+
VK01001201106141553270001SLLEUR00614040000000061404000000006140400000000000000000000000000000000-E000000000K
|
138
|
+
VK01001201106141553270001SOSEUR00225388800000022538880000002253888000000000000000000000000000000+E000000000K
|
139
|
+
VK01001201106141553270001STDEUR02451103200000245110320000024511032000000000000000000000000000000-E000000000K
|
140
|
+
VK01001201106141553270001SVCEUR00001263120000000126312000000012631200000000000000000000000000000+E000000000K
|
141
|
+
VK01001201106141553270001SYPEUR00006855580000000685558000000068555800000000000000000000000000000+E000000000K
|
142
|
+
VK01001201106141553270001SZLEUR00000971920000000097192000000009719200000000000000000000000000000+E000000000K
|
143
|
+
VK01001201106141553270001TOPEUR00000239240000000023924000000002392400000000000000000000000000000+E000000000K
|
144
|
+
VK01001201106141547160001TRYEUR00000228200000000024320000000002132000000000245700000000020570000+K000000000K
|
145
|
+
VK01001201106141553260001TTDEUR00000917450000000091745000000009174500000000000000000000000000000+E000000000K
|
146
|
+
VK01001201106141553270001TWDEUR00004166080000000416608000000041660800000000000000000000000000000+E000000000K
|
147
|
+
VK01001201106141553260001TZSEUR00225677760000022567776000002256777600000000000000000000000000000+E000000000K
|
148
|
+
VK01001201106141553270001UAHEUR00001153670000000115367000000011536700000000000000000000000000000+E000000000K
|
149
|
+
VK01001201106141553270001UGXEUR00347474400000034747440000003474744000000000000000000000000000000+E000000000K
|
150
|
+
VK01001201106141553270001UYUEUR00002651210000000265121000000026512100000000000000000000000000000+E000000000K
|
151
|
+
VK01001201106141553270001VEFEUR00000619720000000061972000000006197200000000000000000000000000000+E000000000K
|
152
|
+
VK01001201106141553270001VNDEUR02967619200000296761920000029676192000000000000000000000000000000+E000000000K
|
153
|
+
VK01001201106141553270001VUVEUR00012629000000001262900000000126290000000000000000000000000000000-E000000000K
|
154
|
+
VK01001201106141553270001WSTEUR00000311650000000031165000000003116500000000000000000000000000000+E000000000K
|
155
|
+
VK01001201106141553260001XAFEUR00065609810000006560981000000656098100000000000000000000000000000+E000000000K
|
156
|
+
VK01001201106141553270001XCDEUR00000385760000000038576000000003857600000000000000000000000000000+E000000000K
|
157
|
+
VK01001201106141553270001XOFEUR00065878550000006587855000000658785500000000000000000000000000000+E000000000K
|
158
|
+
VK01001201106141553270001XPFEUR00011853140000001185314000000118531400000000000000000000000000000-E000000000K
|
159
|
+
VK01001201106141553270001YEREUR00030810360000003081036000000308103600000000000000000000000000000+E000000000K
|
160
|
+
VK01001201106141553270001ZMKEUR00694948800000069494880000006949488000000000000000000000000000000+E000000000K
|
161
|
+
VK01001201106141547130001KZTEUR00021082000000002178200000000203820000000000000000000000000000000-K000000000K
|
162
|
+
VK01001201106141553270001UZSEUR00245873170000024587317000002458731700000000000000000000000000000+E000000000K
|
163
|
+
VK01001199901010750000002EUREUR00000100000000000010000000000001000000000000000000000000000000000+K000000000K
|
164
|
+
VK01001201106141547190002USDEUR00000144480000000014598000000001429800000000000000000000000000000+K000000000K
|
165
|
+
VK01001201106141547140002JPYEUR00011591000000001179100000000113910000000000000000000000000000000+K000000000K
|
166
|
+
VK01001201106141547190002GBPEUR00000088100000000008910000000000871000000000000000000000000000000+K000000000K
|
167
|
+
VK01001201106141547190002SEKEUR00000911830000000092183000000009018300000000000000000000000000000-K000000000K
|
168
|
+
VK01001201106141547170002NOKEUR00000779650000000078965000000007696500000000000000000000000000000-K000000000K
|
169
|
+
VK01001201106141547130002DKKEUR00000745900000000074915000000007426500000000000000000000000000000+K000000000K
|
170
|
+
VK01001201106141547150002CHFEUR00000121160000000012241000000001199100000000000000000000000000000+K000000000K
|
171
|
+
VK01001201101011123110002EEKEUR00001564660000000156466000000015646600000000000000000000000000000 K120110101E
|
172
|
+
VK01001201106141547140002LVLEUR00000070860000000007185000000000698700000000000000000000000000000 K000000000K
|
173
|
+
VK01001201106141547130002LTLEUR00000345280000000034768000000003428800000000000000000000000000000 K000000000K
|
174
|
+
VK01001201106141547170002CADEUR00000140740000000014224000000001392400000000000000000000000000000+K000000000K
|
175
|
+
VK01001201106141547150002HKDEUR00001124560000000114556000000011035600000000000000000000000000000+K000000000K
|
176
|
+
VK01001201106141547190002AUDEUR00000135730000000013773000000001337300000000000000000000000000000-K000000000K
|
177
|
+
VK01001201106141547160002NZDEUR00000176630000000017828000000001749800000000000000000000000000000-K000000000K
|
178
|
+
VK01001201106141547120002ZAREUR00000975400000000100340000000009474000000000000000000000000000000-K000000000K
|
179
|
+
VK01001200801011056450002MTLEUR00000042930000000004293000000000429300000000000000000000000000000-K120080101E
|
180
|
+
VK01001201106141547150002SAREUR00000541945000000054914500000005347450000000000000000000000000000+K000000000K
|
181
|
+
VK01001201106141547120002MADEUR00001133760000000116626000000011012600000000000000000000000000000+K000000000K
|
182
|
+
VK01001201106141547170002KWDEUR00000039635000000004013500000000391350000000000000000000000000000+K000000000K
|
183
|
+
VK01001201106141547120002AEDEUR00000530825000000053592500000005257250000000000000000000000000000+K000000000K
|
184
|
+
VK01001201106141547170002SGDEUR00000178040000000018104000000001750400000000000000000000000000000+K000000000K
|
185
|
+
VK01001201106141547140002MYREUR00000437920000000000000000000000000000000000000000000000000000000+K000000000K
|
186
|
+
VK01001201106141547170002INREUR00006463700000000686370000000060637000000000000000000000000000000+K000000000K
|
187
|
+
VK01001200801011056420002CYPEUR00000058527400000005852740000000585274000000000000000000000000000+K120080101E
|
188
|
+
VK01001201106141547150002RUBEUR00004028880000000427888000000037788800000000000000000000000000000+K000000000K
|
189
|
+
VK01001201106141547170002CZKEUR00002411800000000244780000000023758000000000000000000000000000000-K000000000K
|
190
|
+
VK01001200901010000010002SKKEUR00003012600000000301260000000030126000000000000000000000000000000+K120090101E
|
191
|
+
VK01001201106141547120002PLNEUR00000393020000000040302000000003830200000000000000000000000000000-K000000000K
|
192
|
+
VK01001201106141547140002HUFEUR00026451000000002685100000000260510000000000000000000000000000000-K000000000K
|
193
|
+
VK01001201106141547160002THBEUR00004400900000000450090000000043009000000000000000000000000000000+K000000000K
|
194
|
+
VK01001201106141547170002KRWEUR00156404000000015910400000001537040000000000000000000000000000000+K000000000K
|
195
|
+
VK01001201106141547150002TNDEUR00000197894300000019889430000001968943000000000000000000000000000+K000000000K
|
196
|
+
VK01001201106141547160002XAUEUR00000009515700000001061570000000084157000000000000000000000000000+K000000000K
|
197
|
+
VK01001201106141547150002XYPEUR00000487530000000048883000000004862300000000000000000000000000000+K000000000K
|
198
|
+
VK01001201106141547140002UBFEUR00000474550000000047585000000004732500000000000000000000000000000+K000000000K
|
199
|
+
VK01001201106141547140002KOREUR00000533010000000053461000000005314100000000000000000000000000000+K000000000K
|
200
|
+
VK01001201106141547190002KOXEUR00000465990000000046749000000004644900000000000000000000000000000+K000000000K
|
201
|
+
VK01001201106141547170002XDREUR00000089430000000008953000000000893300000000000000000000000000000+K000000000K
|
202
|
+
VK01001199901011114430002FIMEUR00000594573000000059457300000005945730000000000000000000000000000+K119990101E
|
203
|
+
VK01001199901011114430002DEMEUR00000195583000000019558300000001955830000000000000000000000000000+K119990101E
|
204
|
+
VK01001199901011114430002FRFEUR00000655957000000065595700000006559570000000000000000000000000000+K119990101E
|
205
|
+
VK01001199901011114440002NLGEUR00000220371000000022037100000002203710000000000000000000000000000+K119990101E
|
206
|
+
VK01001199901011114440002ITLEUR00193627000000019362700000001936270000000000000000000000000000000+K119990101E
|
207
|
+
VK01001199901011114440002ATSEUR00001376030000000137603000000013760300000000000000000000000000000+K119990101E
|
208
|
+
VK01001199901011114440002ESPEUR00016638600000001663860000000166386000000000000000000000000000000+K119990101E
|
209
|
+
VK01001199901011114440002IEPEUR00000078756400000007875640000000787564000000000000000000000000000+K119990101E
|
210
|
+
VK01001199901011114450002BEFEUR00004033990000000403399000000040339900000000000000000000000000000+K119990101E
|
211
|
+
VK01001199901011114450002LUFEUR00004033990000000403399000000040339900000000000000000000000000000+K119990101E
|
212
|
+
VK01001199901011114450002PTEEUR00020048200000002004820000000200482000000000000000000000000000000+K119990101E
|
213
|
+
VK01001200012300915000002GRDEUR00034075000000003407500000000340750000000000000000000000000000000 K120010101E
|
214
|
+
VK01001201106141547160002BGNEUR00000195580000000020058000000001905800000000000000000000000000000 K000000000K
|
215
|
+
VK01001201106141547160002HRKEUR00000739950000000075995000000007199500000000000000000000000000000-K000000000K
|
216
|
+
VK01001201106141547120002MXNEUR00001710140000000179014000000016301400000000000000000000000000000+K000000000K
|
217
|
+
VK01001201106141547160002RONEUR00000417250000000042725000000004072500000000000000000000000000000-K000000000K
|
218
|
+
VK01001201106141547130002RSDEUR00010025500000001042550000000096255000000000000000000000000000000+K000000000K
|
219
|
+
VK01001200701021605380002SITEUR00023964000000002396400000000239640000000000000000000000000000000 K120070101E
|
220
|
+
VK01001201106141547160002TRYEUR00000228200000000024320000000002132000000000000000000000000000000+K000000000K
|
221
|
+
VK01001201106141547130002KZTEUR00021082000000002178200000000203820000000000000000000000000000000+K000000000K
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nordea
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matias Korhonen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-06-18 00:00:00.000000000 +03:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: money
|
17
|
+
requirement: &2157191160 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.7.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *2157191160
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: yard
|
28
|
+
requirement: &2157190040 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2157190040
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
requirement: &2157188760 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *2157188760
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: webmock
|
50
|
+
requirement: &2157187440 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *2157187440
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: awesome_print
|
61
|
+
requirement: &2157185080 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *2157185080
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: simplecov
|
72
|
+
requirement: &2157183780 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *2157183780
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rake
|
83
|
+
requirement: &2157182820 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.9.2
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *2157182820
|
92
|
+
description: A Money.gem compatible currency exchange rate implementation for Nordea
|
93
|
+
Bank
|
94
|
+
email:
|
95
|
+
- matias@kiskolabs.com
|
96
|
+
executables: []
|
97
|
+
extensions: []
|
98
|
+
extra_rdoc_files: []
|
99
|
+
files:
|
100
|
+
- .gitignore
|
101
|
+
- .travis.yml
|
102
|
+
- Gemfile
|
103
|
+
- LICENSE
|
104
|
+
- README.md
|
105
|
+
- Rakefile
|
106
|
+
- lib/nordea.rb
|
107
|
+
- lib/nordea/bank.rb
|
108
|
+
- lib/nordea/exchange_rates.rb
|
109
|
+
- lib/nordea/version.rb
|
110
|
+
- nordea.gemspec
|
111
|
+
- spec/bank/bank_spec.rb
|
112
|
+
- spec/exchange_rates/exchange_rates_spec.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
- spec/support/sample_currencies.marshal
|
115
|
+
- spec/support/sample_data.rb
|
116
|
+
- spec/support/sample_electronic.dat
|
117
|
+
- spec/support/sample_headers.marshal
|
118
|
+
has_rdoc: true
|
119
|
+
homepage: http://github.com/k33l0r/nordea
|
120
|
+
licenses: []
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options: []
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
requirements: []
|
138
|
+
rubyforge_project: nordea
|
139
|
+
rubygems_version: 1.6.2
|
140
|
+
signing_key:
|
141
|
+
specification_version: 3
|
142
|
+
summary: Exchange rates from Nordea Bank
|
143
|
+
test_files:
|
144
|
+
- spec/bank/bank_spec.rb
|
145
|
+
- spec/exchange_rates/exchange_rates_spec.rb
|
146
|
+
- spec/spec_helper.rb
|
147
|
+
- spec/support/sample_currencies.marshal
|
148
|
+
- spec/support/sample_data.rb
|
149
|
+
- spec/support/sample_electronic.dat
|
150
|
+
- spec/support/sample_headers.marshal
|