Class: Jsapi::Meta::Schema::Validation::Base
- Inherits:
-
Object
- Object
- Jsapi::Meta::Schema::Validation::Base
- Defined in:
- lib/jsapi/meta/schema/validation/base.rb
Direct Known Subclasses
Enum, MaxItems, MaxLength, Maximum, MinItems, MinLength, Minimum, MultipleOf, Pattern
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ Base
constructor
A new instance of Base.
- #to_json_schema_validation ⇒ Object
- #to_openapi_validation ⇒ Object
Constructor Details
#initialize(value) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/jsapi/meta/schema/validation/base.rb', line 14 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12 13 14 |
# File 'lib/jsapi/meta/schema/validation/base.rb', line 12 def value @value end |
Class Method Details
.keyword ⇒ Object
8 9 10 |
# File 'lib/jsapi/meta/schema/validation/base.rb', line 8 def self.keyword @keyword ||= name.demodulize.camelize(:lower).to_sym end |
Instance Method Details
#to_json_schema_validation ⇒ Object
18 19 20 |
# File 'lib/jsapi/meta/schema/validation/base.rb', line 18 def to_json_schema_validation { self.class.keyword => value } end |
#to_openapi_validation ⇒ Object
22 23 24 |
# File 'lib/jsapi/meta/schema/validation/base.rb', line 22 def to_openapi_validation(*) to_json_schema_validation end |