polyrex-objects 0.1.0 → 0.1.3
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/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
|