jsender 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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -1
  3. data/lib/jsender/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01b62a31ce56dd2516721b7070dbd1bc81c339f9
4
- data.tar.gz: d039fdf0e6881ef6b4ade78b48ffb523b5ff38a1
3
+ metadata.gz: e13bd362c7cce69c241a3a1446528392474d7a80
4
+ data.tar.gz: 504901bd1605a457aa7024450df95a90dd689d9d
5
5
  SHA512:
6
- metadata.gz: c98e1dcb3ad482bc61b430b159b55904175cf488022b4e4319701e871ece9bea7b243481fe59819f8a755829e14124b85d90c60c9426f8700644e419747a90f2
7
- data.tar.gz: c3095381172fd77341a75f079fc12e58001e965b9a34389d8b281438e4dbd5404de1d7ee55bf4f73c16537a5c55b53e3ecfaed3620d19f44874d4810d8be1ec1
6
+ metadata.gz: 915f383ac9d8a6376d08593d62ef4c98fd8748bc9d20c0f4960691b74b2cdc134dbf42f9a8afeeec15a614946886ad4af1e92ae8f8030421f55cc107369d1a4a
7
+ data.tar.gz: 076433744e0a3135623ea77ef34b9f9d6723b03ab8eb4e40204af74dcfdf39141dd8ca808a2b5988866f9b233a9cea98ea3e528ed85492f693ea612a58b4b88c
data/README.md CHANGED
@@ -20,6 +20,54 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
+ ```
24
+ require 'jsender'
25
+
26
+ class CodeClass
27
+ include Jsender
28
+
29
+ def action(code)
30
+ return success if code == 1
31
+ return success('code 2 selected') if code == 2
32
+ return success_data({ 'a' => 'A', 'b' => 'B' }) if code == 3
33
+ return success('some data for you', ['d', 'a', 't', 'a']) if code == 4
34
+ return fail('code 5 selected') if code == 5
35
+ return fail_data({ 'a' => 'A', 'b' => 'B' }) if code == 6
36
+ return fail('some errors for you', ['d', 'a', 't', 'a']) if code == 7
37
+ fail
38
+ end
39
+ end
40
+ ```
41
+
42
+ ```
43
+ iut = CodeClass.new
44
+ ```
45
+
46
+ ```
47
+ iut.action(1)
48
+ => {"status"=>"success", "data"=>{"result"=>nil, "notifications"=>["success"]}}
49
+
50
+ iut.action(2)
51
+ => {"status"=>"success", "data"=>{"result"=>nil, "notifications"=>["code 2 selected"]}}
52
+
53
+ iut.action(3)
54
+ => {"status"=>"success", "data"=>{"a"=>"A", "b"=>"B", "notifications"=>["success"]}}
55
+
56
+ iut.action(4)
57
+ => {"status"=>"success", "data"=>{"result"=>["d", "a", "t", "a"], "notifications"=>["some data for you"]}}
58
+
59
+ iut.action(5)
60
+ => {"status"=>"fail", "data"=>{"result"=>nil, "notifications"=>["code 5 selected"]}}
61
+
62
+ iut.action(6)
63
+ => {"status"=>"fail", "data"=>{"a"=>"A", "b"=>"B", "notifications"=>["fail"]}}
64
+
65
+ iut.action(7)
66
+ => {"status"=>"fail", "data"=>{"result"=>["d", "a", "t", "a"], "notifications"=>["some errors for you"]}}
67
+
68
+ iut.action(0)
69
+ => {"status"=>"fail", "data"=>{"result"=>nil, "notifications"=>["fail"]}}
70
+ ```
23
71
 
24
72
  ## Development
25
73
 
@@ -29,7 +77,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
29
77
 
30
78
  ## Contributing
31
79
 
32
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jsender. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hetznerZA/jsender. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
33
81
 
34
82
 
35
83
  ## License
@@ -1,3 +1,3 @@
1
1
  module Jsender
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsender
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
  - Ernst van Graan