baza.rb 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5ee76f53a0b65c13bb293ebcb18de358f7f7f0d0262b06e1b23c56b337ceefc
4
- data.tar.gz: 064dbdd35e38b6fae3a53c8e2f17abe06927043d0234d182c2b161e1ffed97ba
3
+ metadata.gz: 912ab13ee0311c4e86d24120f46469e871fba77babe19f577b9103c7277a6889
4
+ data.tar.gz: '0890e6eeafc0655074600b85bb2f67076fac6762d7163850f8a67a35778a8110'
5
5
  SHA512:
6
- metadata.gz: e76efbc00aa6c55fba368681dda4ec7560fb7f655f5824bd510bd2fc9da0c23405495f3e7a759655cedcc4dba9a650fc1cdbb9dc8aa0489d873b8f8a7718f0b6
7
- data.tar.gz: 2b908d30e84c97e384e48f99f38dee3fc3f05889cc443711b57ef7dfaf749589a390da4fbb5027fc299d8c460861798e038b876a31a94f7bbdb0fef3a24e9756
6
+ metadata.gz: 1f727b783ed1343d979e533a4113cdc15d0f995328343e1e640bea0035741b6e30862159a045555f004e15e0c19fc6e152d62139b12d2782215f28dc01b98d78
7
+ data.tar.gz: 74beb4a5936c81d094ad47ecfafc7a8cdf65dcb8973623749bcfc95ded8106c4fe3c266d7a3300208a794f45ae9d7e423fc549a73a71b3bf3c0922a55a4cbd25
data/lib/baza-rb/fake.rb CHANGED
@@ -160,15 +160,11 @@ class BazaRb::Fake
160
160
  # @param [String] recipient GitHub name (e.g. "yegor256") of the recipient
161
161
  # @param [Float] amount The amount in Z/USDT (not zents!)
162
162
  # @param [String] summary The description of the payment
163
- # @param [Integer] job The ID of the job or NIL
164
- # @param [Integer] job The amount of points just rewarded
165
- # @return [Integer] Receipt ID
166
- def transfer(recipient, amount, summary, job: nil, points: nil)
163
+ def transfer(recipient, amount, summary, *)
167
164
  raise "The receipient #{recipient.inspect} is not valid" unless recipient.match?(/^[a-zA-Z0-9-]+$/)
168
165
  raise "The amount #{amount} must be a Float" unless amount.is_a?(Float)
169
166
  raise "The amount #{amount} must be positive" unless amount.positive?
170
167
  raise "The summary #{summary.inspect} is empty" if summary.empty?
171
- raise 'The job must go together with points' if !job.nil? && points.nil?
172
168
  42
173
169
  end
174
170
 
@@ -13,5 +13,5 @@
13
13
  # Copyright:: Copyright (c) 2024 Yegor Bugayenko
14
14
  # License:: MIT
15
15
  class BazaRb
16
- VERSION = '0.2.0'
16
+ VERSION = '0.3.0'
17
17
  end
data/lib/baza-rb.rb CHANGED
@@ -467,9 +467,8 @@ class BazaRb
467
467
  # @param [Float] amount The amount in Z/USDT (not zents!)
468
468
  # @param [String] summary The description of the payment
469
469
  # @param [Integer] job The ID of the job or NIL
470
- # @param [Integer] job The amount of points just rewarded
471
470
  # @return [Integer] Receipt ID
472
- def transfer(recipient, amount, summary, job: nil, points: nil)
471
+ def transfer(recipient, amount, summary, job: nil)
473
472
  raise 'The "recipient" is nil' if recipient.nil?
474
473
  raise 'The "amount" is nil' if amount.nil?
475
474
  raise 'The "amount" must be Float' unless amount.is_a?(Float)
@@ -481,11 +480,7 @@ class BazaRb
481
480
  'amount' => amount.to_s,
482
481
  'summary' => summary
483
482
  }
484
- unless job.nil?
485
- body['job'] = job
486
- raise 'The "points" must be Integer' unless points.is_a?(Integer)
487
- body['points'] = points.to_s
488
- end
483
+ body['job'] = job unless job.nil?
489
484
  elapsed(@loog) do
490
485
  ret =
491
486
  with_retries(max_tries: @retries, rescue: TimedOut) do
data/test/test_baza-rb.rb CHANGED
@@ -110,7 +110,7 @@ class TestBazaRb < Minitest::Test
110
110
  stub_request(:post, 'https://example.org/account/transfer').to_return(
111
111
  status: 302, headers: { 'X-Zerocracy-ReceiptId' => '42' }
112
112
  )
113
- id = BazaRb.new('example.org', 443, '000').transfer('jeff', 42.50, 'for fun', job: 555, points: 88)
113
+ id = BazaRb.new('example.org', 443, '000').transfer('jeff', 42.50, 'for fun', job: 555)
114
114
  assert_equal(42, id)
115
115
  end
116
116
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baza.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko