Class: JsonValidation::Validators::Validator
- Inherits:
-
Object
- Object
- JsonValidation::Validators::Validator
- Defined in:
- lib/json_validation/validators/validator.rb
Direct Known Subclasses
AdditionalItems, AdditionalProperties, AllOf, AnyOf, Default, Dependencies, Enum, ExclusiveMaximum, ExclusiveMinimum, Format, Items, MaxItems, MaxLength, MaxProperties, Maximum, MinItems, MinLength, MinProperties, Minimum, MultipleOf, Not, OneOf, Pattern, PatternProperties, Properties, Ref, Required, Type, UniqueItems
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
readonly
Returns the value of attribute base_uri.
-
#fragment ⇒ Object
readonly
Returns the value of attribute fragment.
Class Method Summary collapse
Instance Method Summary collapse
- #build_validator(fragment) ⇒ Object
- #build_validator_with_new_base_uri(fragment, base_uri) ⇒ Object
-
#initialize(fragment, base_uri) ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize(fragment, base_uri) ⇒ Validator
Returns a new instance of Validator.
14 15 16 17 |
# File 'lib/json_validation/validators/validator.rb', line 14 def initialize(fragment, base_uri) @fragment = fragment @base_uri = base_uri end |
Instance Attribute Details
#base_uri ⇒ Object (readonly)
Returns the value of attribute base_uri.
12 13 14 |
# File 'lib/json_validation/validators/validator.rb', line 12 def base_uri @base_uri end |
#fragment ⇒ Object (readonly)
Returns the value of attribute fragment.
12 13 14 |
# File 'lib/json_validation/validators/validator.rb', line 12 def fragment @fragment end |
Class Method Details
.type(type = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/json_validation/validators/validator.rb', line 4 def self.type(type=nil) if type.nil? @type else @type = type end end |
Instance Method Details
#build_validator(fragment) ⇒ Object
19 20 21 |
# File 'lib/json_validation/validators/validator.rb', line 19 def build_validator(fragment) JsonValidation.build_validator(fragment, base_uri) end |
#build_validator_with_new_base_uri(fragment, base_uri) ⇒ Object
23 24 25 |
# File 'lib/json_validation/validators/validator.rb', line 23 def build_validator_with_new_base_uri(fragment, base_uri) JsonValidation.build_validator(fragment, base_uri) end |