Class: OAPI::Types::Object
Direct Known Subclasses
OpenAPI::V30::Components, OpenAPI::V30::Components::SecuritySchemes::Scheme, OpenAPI::V30::Components::SecuritySchemes::Scheme::Flows, OpenAPI::V30::Components::SecuritySchemes::Scheme::Flows::Flow, OpenAPI::V30::Definition, OpenAPI::V30::Examples::Example, OpenAPI::V30::ExternalDocs, OpenAPI::V30::Headers::Header, OpenAPI::V30::Info, OpenAPI::V30::Info::Contact, OpenAPI::V30::Info::License, OpenAPI::V30::Links::Link, OpenAPI::V30::MediaType, OpenAPI::V30::MediaType::Encoding::EncodingItem, OpenAPI::V30::Parameters::Parameter, OpenAPI::V30::Paths::Path, OpenAPI::V30::Paths::Path::Operation, OpenAPI::V30::RequestBody, OpenAPI::V30::Responses::Response, OpenAPI::V30::Servers::Server, OpenAPI::V30::Servers::Server::Variables::Variable, OpenAPI::V30::Tags::Tag, Array, Map
Class Method Summary collapse
Methods included from Properties
included, #initialize, #parse_property_value, #properties
Class Method Details
.parse(json) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/oapi/types/object.rb', line 9 def parse(json) new.tap do |obj| properties.each do |name, type| value = json[name.camelize] next if value.nil? value = type.parse(value) if type obj.send(name, value) end end end |