michelson 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/michelson/michelson.rb +2 -2
- data/lib/michelson/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a937ba2f5f939e2bb71a2b114d2706290bf92855
|
4
|
+
data.tar.gz: 0d74c1ebac63a4f2254181ee6fb590baf4b232a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22e24ecd0075deeb60156d2eadf81c43ee5ae6cd85a45efbb7b5659d24f09eb04cefb7e2ba3ff62b1e7693e871c1788145e87630e53de9e35b09f3de102dd3ee
|
7
|
+
data.tar.gz: 03fa19bd5b4982a16ae5313e74fd64740206181b69c22f4e85b5e504bfc48a362184747770293db46dd284dbca77da5980f9d220d34f50b3d2e111883424db5d
|
data/lib/michelson/michelson.rb
CHANGED
@@ -6,7 +6,7 @@ def type( class_name, *args )
|
|
6
6
|
puts "define type #{class_name}:"
|
7
7
|
pp args
|
8
8
|
|
9
|
-
if args.size == 1 && args[0].is_a?( Class )
|
9
|
+
if args.size == 1 && (args[0].is_a?( Class ) || args[0].is_a?( Module ))
|
10
10
|
klass = args[0]
|
11
11
|
Kernel.const_set( class_name, klass )
|
12
12
|
elsif args.size == 1 && args[0].is_a?( Hash )
|
@@ -14,7 +14,7 @@ def type( class_name, *args )
|
|
14
14
|
klass = Struct.new( *keys )
|
15
15
|
Kernel.const_set( class_name, klass )
|
16
16
|
else
|
17
|
-
raise ArgumentError.new( "Class or Hash expected")
|
17
|
+
raise ArgumentError.new( "Class|Module or Hash expected")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/lib/michelson/version.rb
CHANGED