comandor 0.1.0 → 0.1.1

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: 6e0b29593e35a7fb91b6cdd0c0fc34ee3a692623
4
- data.tar.gz: 9ad986624c8cdfb093ea072e502057a45229e46b
3
+ metadata.gz: d4469d1f307b4725115cbb4b38b4fceb84370cc5
4
+ data.tar.gz: fbb95f8e93f264955fb26866e64e7ff50f8faf1a
5
5
  SHA512:
6
- metadata.gz: 8b1fa0ce8fd269a2665a5db5c84665188e5158a5a0d30f5007a2c6554864c9df185e76c4f25c2726a13881286b13fc56e139e51b1f0e35914b927ce75c1c62ff
7
- data.tar.gz: a6e9ca2625c2fb0b502e7d7544ba3448bae8b3b2c2708958a58da78ce7f94585a879fd9df872ec778eeb6b8615109c3907641483fa1a8120c933f8aac2cc1ddc
6
+ metadata.gz: 22c6faa1d2f03189fd07ba13fe00beeb381b01c88431c7e214c435b645117f8e68462e3a7a651289aff8c47c0756100f47a2a815ce41b0127c57ec6099f76148
7
+ data.tar.gz: 95e664cb7eb59e9d3d46e15fec9c7ea64bf63470448020f83dfb5fcfbbd20e8f50c16ae50d2583bee738024fd520e568bedf40df16995cacabb863307c803afc
data/README.md CHANGED
@@ -69,6 +69,32 @@ class DepositsController < ApplicationController
69
69
  end
70
70
  ```
71
71
 
72
+ Another option to call #perform with any arguments
73
+
74
+ ```ruby
75
+ # Another Service class
76
+ class InvoiceSend
77
+ extend Comandor # here we are!
78
+
79
+ def perform(email = nil, amount = 0)
80
+ return error(:amount, 'Deposit amount should be more than $100') if amount < 100
81
+ return error(:email, 'E-mail is blank') unless email
82
+ create_and_send_invoice(email, amount)
83
+ end
84
+
85
+ private
86
+
87
+ def create_and_send_invoice(email, amount)
88
+ # ... your another code is here
89
+ end
90
+ end
91
+ ```
92
+
93
+ in use:
94
+ ```ruby
95
+ delivery = InvoiceSend.new.perform('renat@aomega.co', 100)
96
+ ```
97
+
72
98
  ## Development
73
99
 
74
100
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -12,7 +12,7 @@ module Comandor
12
12
  end
13
13
 
14
14
  # @return [self]
15
- def perform
15
+ def perform(*args, &block)
16
16
  raise NoMethodError unless defined?(:perform)
17
17
  @result = super
18
18
  @done = true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comandor
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comandor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renat Ibragimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-11 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler