PipedrivePUT 1.1.35 → 1.1.36

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40e19c158a29219f4962938fd10e1a3ffcbc2274
4
- data.tar.gz: ec6966f4cccdcae8a7413cdfb9726daefec27cdf
3
+ metadata.gz: 31cc87dc6a10b4576921abbebe6b1205b6fd3ba5
4
+ data.tar.gz: 0d3912db82bc8af846a50a81cea969f9238f9f78
5
5
  SHA512:
6
- metadata.gz: 362358a263e670410bc26c81a5582a5618186a5115d567e21632f366bebbddc466b9bc501ff260efe75f65126030bca871e9c73820c2580dac51ccea2c223477
7
- data.tar.gz: 85df3a4778b8dc1185e70d4d8157e4cd4310dde10799b8bae38de6a679db3df4e6b59cefdab80ba977f8b21d0c0d553cc25ccfef8d2a9096e4cd58ce5fc3c550
6
+ metadata.gz: 4c18660ed24ce76649827ec7f9387fee431130877b234e0b2c312f5572055c49368500d7e4b48d8d92d6cbe86e9b36a3664a9fdd1b633f4db00e1a4a5984b9a0
7
+ data.tar.gz: b806227339628fb3dcd57390637024f334829ff6e79dc6d539edae8fc126ffaa8b1e6041fdcb4b4c5ab16147a2fa3128ecd7ab06d5eabf50b265f135e2148fc6
@@ -2,17 +2,26 @@ module PipedrivePUT
2
2
  class Currencies
3
3
  include PipedrivePUT
4
4
 
5
+
6
+ def self.getExchangeRate(currency_name, options = {})
7
+ get_curr = PipedrivePUT::Currencies.getCurr(currency_name)
8
+ get_code = get_curr['data'][0]['code']
9
+ Money::Bank::GoogleCurrency.ttl_in_seconds = 86400
10
+ Money.default_bank = Money::Bank::GoogleCurrency.new
11
+ get_amount = options[:amount].to_i
12
+ set_new_exchange = options[:ex_code].parameterize.to_sym
13
+ set_amount_and_code_to_exchange = Money.new(get_amount, get_code)
14
+ exchange_rate = set_amount_and_code_to_exchange
15
+ formated_rate = exchange_rate.exchange_to(set_new_exchange).format
16
+ end
5
17
 
6
- #---------------------------------------------------------get all currencies----------------------------------------------------------------------------------------------------------------------
7
18
  def self.getAllCurr
8
19
  @base = 'https://api.pipedrive.com/v1/currencies?api_token=' + @@key.to_s
9
20
  @content = open(@base.to_s).read
10
21
  @parsed = JSON.parse(@content)
11
22
  return @parsed
12
23
  end
13
- #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14
24
 
15
- #----------------------------------------- search for currencies -----------------------------------------------------------------------------------------------------------------------------------
16
25
  def self.getCurr(currency_name)
17
26
  curr_string = currency_name.to_s
18
27
  curr_string_count = curr_string.split.size
@@ -62,26 +71,8 @@ module PipedrivePUT
62
71
  @parsed = JSON.parse(@content)
63
72
  return @parsed
64
73
  end
65
- end
66
- #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
74
+ end
67
75
  end
68
-
69
- #----------------------------------------------------------------------------------------Currency Calculator------------------------------------------------------------------------------------
70
-
71
- def self.getExchangeRate(currency_name, options = {})
72
- get_curr = PipedrivePUT::Currencies.getCurr(currency_name)
73
- get_code = get_curr['data'][0]['code']
74
- Money::Bank::GoogleCurrency.ttl_in_seconds = 86400
75
- Money.default_bank = Money::Bank::GoogleCurrency.new
76
- get_amount = options[:amount].to_i
77
- set_new_exchange = options[:ex_code].parameterize.to_sym
78
- set_amount_and_code_to_exchange = Money.new(get_amount, get_code)
79
- exchange_rate = set_amount_and_code_to_exchange
80
- formated_rate = exchange_rate.exchange_to(set_new_exchange).format
81
- return formated_rate
82
- end
83
- #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
84
-
85
76
  end
86
77
 
87
78
 
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.35"
2
+ VERSION = "1.1.36"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PipedrivePUT
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.35
4
+ version: 1.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71