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.
Files changed (2) hide show
  1. data/lib/polyrex-objects.rb +5 -1
  2. metadata +1 -1
@@ -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.captalize
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors: []
7
7