Module: Taro::Types::Shared::OpenAPIFormat
- Defined in:
- lib/taro/types/shared/openapi_format.rb
Overview
Provides a setter and getter for type classes’ ‘openapi_format`, for use in the OpenAPI export.
Constant Summary collapse
- OPENAPI_STRING_FORMATS =
%i[ date date-time password byte binary email uuid uri hostname ipv4 ipv6 ].freeze
- OPENAPI_INTEGER_FORMATS =
%i[ int32 int64 ].freeze
- OPENAPI_NUMBER_FORMATS =
%i[ float double ].freeze
Instance Method Summary collapse
Instance Method Details
#inherited(subclass) ⇒ Object
42 43 44 45 |
# File 'lib/taro/types/shared/openapi_format.rb', line 42 def inherited(subclass) subclass.instance_variable_set(:@openapi_format, @openapi_format) super end |
#openapi_format ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/taro/types/shared/openapi_format.rb', line 28 def openapi_format return unless @openapi_format unless valid_formats_for_openapi_type.include?(@openapi_format) raise(Taro::ArgumentError, "openapi_format #{@openapi_format.inspect} is invalid for openapi_type #{@openapi_type.inspect}, must be one for #{valid_formats_for_openapi_type}") end @openapi_format end |
#openapi_format=(arg) ⇒ Object
38 39 40 |
# File 'lib/taro/types/shared/openapi_format.rb', line 38 def openapi_format=(arg) @openapi_format = arg end |