multitype-introspection 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.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/multitype-introspection.rb +10 -1
- data/multitype-introspection.gemspec +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -6,7 +6,7 @@ the [Object][1] class with following methods:
|
|
6
6
|
|
7
7
|
* [#kind_of_any?][2]
|
8
8
|
* [#is_a_any?][3]
|
9
|
-
* [#instance_of_any][4]
|
9
|
+
* [#instance_of_any?][4]
|
10
10
|
|
11
11
|
Aim of these is probably evident -- they are equivalent of appropriate
|
12
12
|
methods without `any` suffix, but for multiple classes. An example of
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -1,11 +1,17 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
|
3
3
|
|
4
|
+
##
|
5
|
+
# Built-in Object class extension.
|
6
|
+
|
4
7
|
class Object
|
5
8
|
|
6
9
|
##
|
7
10
|
# Returns <tt>true</tt> if obj is an instance of the given classes.
|
8
|
-
#
|
11
|
+
#
|
12
|
+
# @see Object#kind_of_any?
|
13
|
+
# @param [Array] classes array of class objects
|
14
|
+
# @return [Boolean] 'true' if it is, 'false' in otherwise
|
9
15
|
#
|
10
16
|
|
11
17
|
def instance_of_any?(classes)
|
@@ -27,6 +33,9 @@ class Object
|
|
27
33
|
# if one of classes are one of the superclasses of obj or modules
|
28
34
|
# included in obj.
|
29
35
|
#
|
36
|
+
# @param [Array] classes array of class objects
|
37
|
+
# @return [Boolean] 'true' if it is, 'false' in otherwise
|
38
|
+
#
|
30
39
|
|
31
40
|
def kind_of_any?(classes)
|
32
41
|
if not classes.kind_of? Array
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{multitype-introspection}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Kozák"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-19}
|
13
13
|
s.email = %q{martinkozak@martinkozak.net}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Martin Koz\xC3\xA1k"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-19 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -80,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
hash: -
|
83
|
+
hash: -3522651059684417066
|
84
84
|
segments:
|
85
85
|
- 0
|
86
86
|
version: "0"
|