structure 0.7.0 → 0.7.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/lib/structure.rb +9 -7
- data/lib/structure/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
data/lib/structure.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
# Ruby doesn't have a Boolean class, so let's feign one.
|
4
|
+
unless Object.const_defined?(:Boolean)
|
5
|
+
module Boolean; end
|
6
|
+
class TrueClass; include Boolean; end
|
7
|
+
class FalseClass; include Boolean; end
|
8
|
+
end
|
9
|
+
|
1
10
|
# A Struct-like data container.
|
2
11
|
class Structure
|
3
12
|
include Enumerable
|
4
13
|
|
5
|
-
# Ruby doesn't have a Boolean class, so let's feign one.
|
6
|
-
unless Object.const_defined?(:Boolean)
|
7
|
-
module ::Boolean; end
|
8
|
-
class ::TrueClass; include Boolean; end
|
9
|
-
class ::FalseClass; include Boolean; end
|
10
|
-
end
|
11
|
-
|
12
14
|
TYPES = [Array, Boolean, Float, Hash, Integer, String, Structure, URI]
|
13
15
|
|
14
16
|
class << self
|
data/lib/structure/version.rb
CHANGED