Class: Raml::Schema
Instance Attribute Summary
Attributes inherited from ValueNode
Attributes inherited from Node
Instance Method Summary collapse
-
#json_schema? ⇒ Boolean
True if the schema appears to be an JSON Schema, false otherwise.
-
#xml_schema? ⇒ Boolean
True if the schema appears to be an XML Schema, false otherwise.
Methods inherited from ValueNode
Methods inherited from Node
Constructor Details
This class inherits a constructor from Raml::ValueNode
Instance Method Details
#json_schema? ⇒ Boolean
Returns true if the schema appears to be an JSON Schema, false otherwise.
6 7 8 |
# File 'lib/raml/node/schema.rb', line 6 def json_schema? /"\$schema":\s*"http:\/\/json-schema.org\/[^"]*"/ === @value end |
#xml_schema? ⇒ Boolean
Returns true if the schema appears to be an XML Schema, false otherwise.
11 12 13 |
# File 'lib/raml/node/schema.rb', line 11 def xml_schema? /<xs:schema [^>]*xmlns:xs="http:\/\/www\.w3\.org\/2001\/XMLSchema"[^>]*>/ === @value end |