Module: Nordea
- Defined in:
- lib/nordea.rb,
lib/nordea/bank.rb,
lib/nordea/version.rb,
lib/nordea/exchange_rates.rb
Overview
Defined Under Namespace
Classes: Bank, ExchangeRates, ServerError
Constant Summary collapse
- TZ =
The default timezone, Europe/Helsinki
TZInfo::Timezone.get("Europe/Helsinki")
- VERSION =
The gem version
"2.0.2"
Class Method Summary collapse
-
.parse_date(date) ⇒ Date
Parses the date format used in the Nordea data.
-
.parse_time(datetime) ⇒ Time
Parses the datetime format used in the Nordea data.
Class Method Details
.parse_date(date) ⇒ Date
Parses the date format used in the Nordea data.
36 37 38 39 40 41 42 |
# File 'lib/nordea.rb', line 36 def self.parse_date(date) Date.new(date[0..3].to_i, date[4..5].to_i, date[6..7].to_i) rescue nil end |
.parse_time(datetime) ⇒ Time
Parses the datetime format used in the Nordea data.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nordea.rb', line 18 def self.parse_time(datetime) time = Time.utc( datetime[0..3].to_i, datetime[4..5].to_i, datetime[6..7].to_i, datetime[8..9].to_i, datetime[10..11].to_i, datetime[11..12].to_i ) # Convert the local time to UTC time. TZ.local_to_utc(time) rescue nil end |