Class: PolyrexObjectMethods
- Inherits:
-
Object
- Object
- PolyrexObjectMethods
- Defined in:
- lib/polyrex-object-methods.rb
Overview
file: polyrex-object-methods.rb
Instance Method Summary collapse
-
#initialize(schema) ⇒ PolyrexObjectMethods
constructor
A new instance of PolyrexObjectMethods.
- #to_a ⇒ Object
Constructor Details
#initialize(schema) ⇒ PolyrexObjectMethods
Returns a new instance of PolyrexObjectMethods.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/polyrex-object-methods.rb', line 7 def initialize(schema) a = schema.split('/') a.shift @a = a.map do |x| name, raw_fields = x.split('[') [name.capitalize, raw_fields ? raw_fields.chop.split(',').map(&:strip) : []] end end |
Instance Method Details
#to_a ⇒ Object
18 19 20 |
# File 'lib/polyrex-object-methods.rb', line 18 def to_a @a end |