Class: Rogdl::Schema
- Inherits:
-
Object
- Object
- Rogdl::Schema
- Defined in:
- lib/schema.rb
Constant Summary collapse
- ExactlyOne =
'{1}'
- OneOrMore =
'{1..n}'
- ZeroOrOne =
'{0..1}'
- ZeroOrMore =
'{0..n}'
- Rules =
[ExactlyOne, OneOrMore, ZeroOrOne, ZeroOrMore]
Instance Method Summary collapse
-
#initialize(aSchema) ⇒ Schema
constructor
A new instance of Schema.
- #validate(aNode) ⇒ Object
Constructor Details
#initialize(aSchema) ⇒ Schema
Returns a new instance of Schema.
13 14 15 |
# File 'lib/schema.rb', line 13 def initialize(aSchema) @schema = aSchema end |
Instance Method Details
#validate(aNode) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/schema.rb', line 17 def validate(aNode) = [] if @schema.gname != aNode.gname return ["Expecting '#{@schema.gname}', but found '#{aNode.gname}'"] end val(aNode, @schema, ) return end |