commissioner-guy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/commissioner.rb +3 -2
- data/lib/commissioner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb1b3818342e1107e234cbe7e2a481b30c72bd3bf7174605e8921f91fccee38
|
4
|
+
data.tar.gz: 695f7c5dc02cdd714c7447a22b46b11270b39675d3bd69eac343ecc27e51893d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31336d4befff623aaeb484df1b78eec7e43b5ad2b26054178ce73a1b953cc0bf413e9bc2c7621a02d7d89353bc88a7b073584aae2bf31329ca88b28fe93967e6
|
7
|
+
data.tar.gz: 0fdf56576c7b4df1cdb7c74be8d082e15a826ddd1ceb60ac668e0b1e3c9816072997dc8e55a9d5fa6e1991e17f3c92c5ea3c4374353df3a303362c49afbe94b5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# Commissioner Guy
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/mrexox/commissioner.svg?branch=main)](https://travis-ci.org/mrexox/commissioner)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/commissioner-guy.svg)](https://badge.fury.io/rb/commissioner-guy)
|
4
5
|
|
5
|
-
Calculates charged and received amounts
|
6
|
+
Calculates charged and received amounts based on provided one. Calls your exchanger if needed. Applies commissions in order that you define.
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
data/lib/commissioner.rb
CHANGED
@@ -9,8 +9,9 @@ module Commissioner
|
|
9
9
|
extend Dry::Configurable
|
10
10
|
|
11
11
|
# A lambda that accepts from_currency, to_currency, amount
|
12
|
-
setting :exchanger,
|
13
|
-
|
12
|
+
setting :exchanger, -> (_from, _to, amount) { amount }, reader: true
|
13
|
+
# Possible values: :up, :down, :half_up, :half_even
|
14
|
+
setting :rounding_mode, :half_up
|
14
15
|
|
15
16
|
def self.calculate(params)
|
16
17
|
Calculator.new(params, config: config).calculate
|
data/lib/commissioner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commissioner-guy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valentine Kiselev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-auto_inject
|