convertator 0.3.0 → 0.3.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: 022c887fe0bd212569243795a54a18e0b746dc23
4
- data.tar.gz: 0acc04318bf82853fef66660e2aee623c626f8be
3
+ metadata.gz: 6c1a1c529927924720595fed8a68974586039bba
4
+ data.tar.gz: a6e16262347e9e634696c054de15ec471cabd932
5
5
  SHA512:
6
- metadata.gz: 154ac3ec7baebf2b6fa19b707ddd990c9e300591e0a540ac040cb96d4aa096adf3fd27db89401722de79362ea8c139f9618bd1c5dff907928449f2fe6fb5382f
7
- data.tar.gz: 44c39d3a310f2aeb0a850f0488536275a10766cdcdd3254ce2196cc9d37966a827023060b3fc2b12dd89a50be05aac0c4cb534f092743dbeef91119c9634fd72
6
+ metadata.gz: f3bd34ead3b144c42786fcbff44efb29165eb61ab93a9dc88fb64b3f0a1e155241c917d15fb42cf0a53a7deadd119f8c322639ff11b36724ca850d2488e20c92
7
+ data.tar.gz: de84c39003a37f5df0eb6654ea6783b064d850f7f089a1794a3262a05f43bcf1c9b3301de12367d9976cd7fc52cdde5b6895058223225695af03a2939612e410
data/lib/convertator.rb CHANGED
@@ -1,5 +1,10 @@
1
1
  require 'convertator/version'
2
+ require 'convertator/utils'
3
+ require 'convertator/middleware'
4
+ require 'convertator/converter'
5
+ require 'convertator/providers/cbr_provider'
6
+ require 'convertator/providers/static_provider'
7
+ require 'convertator/middlewares/file_cache_middleware'
2
8
 
3
9
  module Convertator
4
- # Your code goes here...
5
10
  end
@@ -1,10 +1,14 @@
1
1
  require 'bigdecimal'
2
2
  require 'bigdecimal/util'
3
+ require 'convertator/utils'
4
+ require 'convertator/middleware'
3
5
 
4
6
  module Convertator
5
7
  class Converter
6
8
  class UnknownCurrencyError < StandardError; end
7
9
 
10
+ include Convertator::Utils
11
+
8
12
  attr_reader :provider
9
13
 
10
14
  def initialize(provider = :cbr, accuracy = 10)
@@ -56,16 +60,6 @@ module Convertator
56
60
 
57
61
  private
58
62
 
59
- def symbolize_keys(array)
60
- array.each_with_object({}) do |(k, v), memo|
61
- memo[normalize_currency(k)] = v
62
- end
63
- end
64
-
65
- def normalize_currency(currency)
66
- currency.to_sym.upcase
67
- end
68
-
69
63
  def round(value)
70
64
  BigDecimal.save_rounding_mode do
71
65
  BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up)
@@ -1,3 +1,3 @@
1
1
  module Convertator
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convertator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Zinovyev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler