Class: PolyrexSchema
- Inherits:
-
Object
- Object
- PolyrexSchema
- Defined in:
- lib/polyrex-schema.rb
Instance Method Summary collapse
-
#initialize(s) ⇒ PolyrexSchema
constructor
A new instance of PolyrexSchema.
- #to_a ⇒ Object
- #to_doc ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(s) ⇒ PolyrexSchema
Returns a new instance of PolyrexSchema.
9 10 11 12 13 14 15 16 17 |
# File 'lib/polyrex-schema.rb', line 9 def initialize(s) s.prepend 'root/' if s[0] == '{' a = s.split('/') r = add_node a r[3] << node('recordx_type', 'polyrex') << node('schema',s) @doc = Rexle.new(r) end |
Instance Method Details
#to_a ⇒ Object
19 20 21 |
# File 'lib/polyrex-schema.rb', line 19 def to_a() scan_to_a(@doc.root.xpath 'records/.') end |
#to_doc ⇒ Object
23 24 25 |
# File 'lib/polyrex-schema.rb', line 23 def to_doc() @doc end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/polyrex-schema.rb', line 27 def to_s() @doc.to_s end |