Class: Jsapi::Meta::Schema::Validation::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/jsapi/meta/schema/validation/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject (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

.keywordObject



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_validationObject



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_validationObject



22
23
24
# File 'lib/jsapi/meta/schema/validation/base.rb', line 22

def to_openapi_validation(*)
  to_json_schema_validation
end