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 +4 -4
- data/README.md +26 -0
- data/lib/comandor.rb +1 -1
- data/lib/comandor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d4469d1f307b4725115cbb4b38b4fceb84370cc5
|
|
4
|
+
data.tar.gz: fbb95f8e93f264955fb26866e64e7ff50f8faf1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/comandor.rb
CHANGED
data/lib/comandor/version.rb
CHANGED
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.
|
|
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
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|