callable 0.0.4 → 0.0.5
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/lib/callable.rb +5 -2
- data/lib/callable/version.rb +1 -1
- data/spec/callable_spec.rb +6 -0
- 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: 5b9a1c55e8f4d5e655fd34c998ad76daaa3342b1
|
4
|
+
data.tar.gz: a6a65ff3463dec2a89868aeb1f4c11beae5db641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78d3d785093558746d22bdab79a5bcbc6629d532c322cd790bb1c6b9bad90842f2b634b1c223e52611ae6473b93081195af00808a6f277850ed99cf72b0de71b
|
7
|
+
data.tar.gz: 72d7aee36ffdf8964607117028d94f5c1bdd5f19972d0fa4d699a0e1c29e9726208db3ab8220943bbdb1081d3aff72a928fa620c546ca7bb5e820f8acb97075a
|
data/lib/callable.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require "callable/version"
|
2
2
|
|
3
3
|
module Callable
|
4
|
-
def Callable( callable_or_not, default:
|
5
|
-
return Callable(default) if callable_or_not.nil?
|
4
|
+
def Callable( callable_or_not, default: Undefined )
|
5
|
+
return Callable(default) if callable_or_not.nil? && default != Undefined
|
6
6
|
if callable_or_not.respond_to?(:call)
|
7
7
|
callable_or_not
|
8
8
|
else
|
@@ -17,6 +17,9 @@ module Callable
|
|
17
17
|
def callable?
|
18
18
|
self.respond_to?(:call)
|
19
19
|
end
|
20
|
+
|
21
|
+
class Undefined < BasicObject; end
|
22
|
+
|
20
23
|
end
|
21
24
|
|
22
25
|
::Object.include(Callable)
|
data/lib/callable/version.rb
CHANGED
data/spec/callable_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: callable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Iachetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|