Class: Hv::Schema
- Inherits:
-
Object
- Object
- Hv::Schema
- Defined in:
- lib/hv/schema.rb
Instance Method Summary collapse
- #allowed_validators ⇒ Object
-
#initialize(schema) ⇒ Schema
constructor
A new instance of Schema.
- #path ⇒ Object
- #result ⇒ Object
- #validates?(input) ⇒ Boolean
Constructor Details
#initialize(schema) ⇒ Schema
Returns a new instance of Schema.
8 9 10 |
# File 'lib/hv/schema.rb', line 8 def initialize(schema) @schema = schema end |
Instance Method Details
#allowed_validators ⇒ Object
4 5 6 |
# File 'lib/hv/schema.rb', line 4 def allowed_validators [:optional?, :format?, :min_size?, :max_size?, :size?, :lt?, :gt?, :types?, :type?, :enum?, :proc?, :array?, :empty?] end |
#path ⇒ Object
16 17 18 |
# File 'lib/hv/schema.rb', line 16 def path @path end |
#result ⇒ Object
12 13 14 |
# File 'lib/hv/schema.rb', line 12 def result @result end |
#validates?(input) ⇒ Boolean
20 21 22 23 |
# File 'lib/hv/schema.rb', line 20 def validates?(input) @result = [] validate_schema(@schema, input, []) end |