Class: OAPI::OpenAPI::V30::Serializers::Ruby::Wrapper
- Inherits:
-
Object
- Object
- OAPI::OpenAPI::V30::Serializers::Ruby::Wrapper
- Defined in:
- lib/oapi/open_api/v30/serializers/ruby.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #bind ⇒ Object
-
#initialize(object) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #serialize(node) ⇒ Object
- #serialize_if_supported(node) ⇒ Object
- #supported?(node) ⇒ Boolean
- #value_to_ruby(value) ⇒ Object
Constructor Details
#initialize(object) ⇒ Wrapper
Returns a new instance of Wrapper.
43 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 43 def initialize(object) = @object = object |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
41 42 43 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 41 def object @object end |
Instance Method Details
#bind ⇒ Object
45 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 45 def bind = binding |
#serialize(node) ⇒ Object
47 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 47 def serialize(node) = OAPI::OpenAPI::V30::Serializers::Ruby.serialize(node) |
#serialize_if_supported(node) ⇒ Object
49 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 49 def serialize_if_supported(node) = OAPI::OpenAPI::V30::Serializers::Ruby.serialize_if_supported(node) |
#supported?(node) ⇒ Boolean
48 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 48 def supported?(node) = OAPI::OpenAPI::V30::Serializers::Ruby.supported?(node) |
#value_to_ruby(value) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/oapi/open_api/v30/serializers/ruby.rb', line 51 def value_to_ruby(value) return value.inspect if [Numeric, String, Array, TrueClass, FalseClass].any? { value.is_a?(_1) } return "(#{value.inspect})" if value.is_a?(Hash) raise ArgumentError, "value: #{value}" end |