multi_type 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23b0785b71180fea2fd0096e7626dff20d0f7ee0
4
- data.tar.gz: e26a7ddc88aca4c26610775440ff07efb730134b
3
+ metadata.gz: 629a1484c92cc74994972dadea22b83bbde645a5
4
+ data.tar.gz: 3c536ff19cda406925ac83a5e6fb512da09a4609
5
5
  SHA512:
6
- metadata.gz: e63f8d7c494549132f6af17bee1f346172529ad5f69c78ad9d45158188b2af9a88fcfc8c2cf3c8f768faeb59f553f03c49fc6b7fcf022ba04fe1919a1246f583
7
- data.tar.gz: 60afa3c9b04e62ff23f523e2e8ad34b9c25bf428a92edfb2ca92b6b7727cbebbd14811bc196bfd31d1b598db875c8f4ea4fdf62ccae633313ffa11226d5e3147
6
+ metadata.gz: 522e8bbd21769ee613fc1b5d7b75b38d7f2f40fd08822736593270e53f60d4b03af10af3bc3c9a4249aa71a5a91229b85b5517c6909b2a3b99ecf61a2ed2ba3b
7
+ data.tar.gz: 3fb2f2afbfb0598c7926223e236214aa944370021bb9038e7b9f4d7bf679165ded422ea6c0a9a3ad43ae86125025229ace0f1c67e7e834af590f9a37391247d2
data/README.md CHANGED
@@ -93,6 +93,15 @@ ConnectionErrors = MultiType[
93
93
  SocketErrors # note that this is a multi type
94
94
  ]
95
95
 
96
+ # or like that. Does the same thing:
97
+
98
+ ConnectionErrors = SocketErrors.add(
99
+ Excon::Errors::ResponseParseError,
100
+ Excon::Errors::SocketError,
101
+ Excon::Errors::Timeout,
102
+ Net::HTTPBadResponse
103
+ )
104
+
96
105
  # Now ConnectionErrors include all SocketErrors and a bunch of new types
97
106
  ```
98
107
 
@@ -23,6 +23,10 @@ module MultiType
23
23
  group.public_send m, *args
24
24
  end
25
25
  end
26
+
27
+ def add(*other)
28
+ MultiType[self, *other]
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -1,3 +1,3 @@
1
1
  module MultiType
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_type
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud