Class: Jsapi::Meta::Schema::String
- Inherits:
-
Base
- Object
- Model::Base
- Base
- Jsapi::Meta::Schema::String
- Includes:
- Conversion
- Defined in:
- lib/jsapi/meta/schema/string.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#format ⇒ Object
:attr: format The format of a string.
-
#max_length ⇒ Object
:attr: max_length The maximum length of a string.
-
#max_length=(value) ⇒ Object
:nodoc:.
-
#min_length ⇒ Object
:attr: min_length The minimum length of a string.
-
#min_length=(value) ⇒ Object
:nodoc:.
-
#pattern ⇒ Object
:attr: pattern The regular expression a string must match.
-
#pattern=(value) ⇒ Object
:nodoc:.
-
#to_json_schema ⇒ Object
:nodoc:.
-
#to_openapi ⇒ Object
:nodoc:.
Methods included from Conversion
Methods inherited from Base
#default, #deprecated, #description, #enum, #enum=, #examples, #existence, #external_docs, #initialize, #nullable?, #omittable?, #title, #type
Methods included from OpenAPI::Extensions
Methods inherited from Model::Base
#initialize, #inspect, #merge!, #reference?, #resolve
Methods included from Model::Attributes
#attributes_frozen?, #freeze_attributes, included
Constructor Details
This class inherits a constructor from Jsapi::Meta::Schema::Base
Instance Method Details
#format ⇒ Object
:attr: format The format of a string.
12 |
# File 'lib/jsapi/meta/schema/string.rb', line 12 attribute :format, ::String |
#max_length ⇒ Object
:attr: max_length The maximum length of a string.
17 |
# File 'lib/jsapi/meta/schema/string.rb', line 17 attribute :max_length, accessors: %i[reader] |
#max_length=(value) ⇒ Object
:nodoc:
29 30 31 32 33 34 |
# File 'lib/jsapi/meta/schema/string.rb', line 29 def max_length=(value) # :nodoc: try_modify_attribute!(:max_length) do add_validation('max_length', Validation::MaxLength.new(value)) @max_length = value end end |
#min_length ⇒ Object
:attr: min_length The minimum length of a string.
22 |
# File 'lib/jsapi/meta/schema/string.rb', line 22 attribute :min_length, accessors: %i[reader] |
#min_length=(value) ⇒ Object
:nodoc:
36 37 38 39 40 41 |
# File 'lib/jsapi/meta/schema/string.rb', line 36 def min_length=(value) # :nodoc: try_modify_attribute!(:min_length) do add_validation('min_length', Validation::MinLength.new(value)) @min_length = value end end |
#pattern ⇒ Object
:attr: pattern The regular expression a string must match.
27 |
# File 'lib/jsapi/meta/schema/string.rb', line 27 attribute :pattern, accessors: %i[reader] |
#pattern=(value) ⇒ Object
:nodoc:
43 44 45 46 47 48 |
# File 'lib/jsapi/meta/schema/string.rb', line 43 def pattern=(value) # :nodoc: try_modify_attribute!(:pattern) do add_validation('pattern', Validation::Pattern.new(value)) @pattern = value end end |
#to_json_schema ⇒ Object
:nodoc:
50 51 52 |
# File 'lib/jsapi/meta/schema/string.rb', line 50 def to_json_schema # :nodoc: format ? super.merge(format: format) : super end |
#to_openapi ⇒ Object
:nodoc:
54 55 56 |
# File 'lib/jsapi/meta/schema/string.rb', line 54 def to_openapi(*) # :nodoc: format ? super.merge(format: format) : super end |