types 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/types.rb +8 -8
- data/types.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/types.rb
CHANGED
@@ -39,8 +39,8 @@ module Types
|
|
39
39
|
##
|
40
40
|
# Matches object is of this type.
|
41
41
|
#
|
42
|
-
#
|
43
|
-
# @return [Boolean]
|
42
|
+
# @param [Object] object object for type matching
|
43
|
+
# @return [Boolean] +true+ if match, +false+ in otherwise
|
44
44
|
#
|
45
45
|
|
46
46
|
def match_type?(object)
|
@@ -63,7 +63,7 @@ module Types
|
|
63
63
|
|
64
64
|
##
|
65
65
|
# Returns classes which are part of this type.
|
66
|
-
# In case of boolean
|
66
|
+
# In case of boolean +TrueClass+ and +FalseClass+.
|
67
67
|
#
|
68
68
|
# @return [Array] array of types objects
|
69
69
|
#
|
@@ -83,10 +83,10 @@ class Object
|
|
83
83
|
|
84
84
|
##
|
85
85
|
# Indicates object is type of some class.
|
86
|
-
# If class isn't Type, matches against
|
86
|
+
# If class isn't {Types::Type Type}, matches against +#kind_of?+.
|
87
87
|
#
|
88
88
|
# @param [Types::Type, Class] cls some type or class specification
|
89
|
-
# @return [Boolean]
|
89
|
+
# @return [Boolean] +true+ if it is, +false+ in otherwise
|
90
90
|
#
|
91
91
|
|
92
92
|
def type_of?(cls)
|
@@ -100,10 +100,10 @@ class Object
|
|
100
100
|
|
101
101
|
##
|
102
102
|
# Indicates object is type of some class in the list.
|
103
|
-
# If class isn't Type, matches against
|
103
|
+
# If class isn't {Types::Type Type}, matches against +#kind_of?+.
|
104
104
|
#
|
105
|
-
# @param [Array] classes array of Type or Class objects
|
106
|
-
# @return [Boolean]
|
105
|
+
# @param [Array] classes array of {Types::Type Type} or +Class+ objects
|
106
|
+
# @return [Boolean] +true+ if it is, +false+ in otherwise
|
107
107
|
#
|
108
108
|
|
109
109
|
def type_of_any?(classes)
|
data/types.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{types}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
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-27}
|
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
|
+
- 2
|
9
|
+
version: 0.1.2
|
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-27 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
hash:
|
98
|
+
hash: 1047582636863163754
|
99
99
|
segments:
|
100
100
|
- 0
|
101
101
|
version: "0"
|