polyrex-objects 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/polyrex-objects.rb +5 -1
- metadata +1 -1
data/lib/polyrex-objects.rb
CHANGED
@@ -12,7 +12,7 @@ class PolyrexObjects
|
|
12
12
|
a.each do |x|
|
13
13
|
name, raw_fields = x.split('[')
|
14
14
|
fields = raw_fields.chop.split(',').map &:strip
|
15
|
-
@class_names << name.
|
15
|
+
@class_names << name.capitalize
|
16
16
|
|
17
17
|
classx = []
|
18
18
|
classx << "class #{name.capitalize}"
|
@@ -30,4 +30,8 @@ class PolyrexObjects
|
|
30
30
|
def to_a
|
31
31
|
@class_names.map {|x| eval(x)}
|
32
32
|
end
|
33
|
+
|
34
|
+
def to_h
|
35
|
+
Hash[self.to_a.map {|x| [x.name[/\w+$/], x]}]
|
36
|
+
end
|
33
37
|
end
|