Class: Graphiti::OpenAPI::Schema

Inherits:
Struct
  • Object
show all
Defined in:
app/models/graphiti/open_api/schema.rb

Instance Method Summary collapse

Instance Method Details

#endpointsEndpoints{String => Endpoint}

Returns:



19
20
21
# File 'app/models/graphiti/open_api/schema.rb', line 19

def endpoints
  Endpoints.load(self)
end

#resourcesResources{String => Resource}

Returns:



14
15
16
# File 'app/models/graphiti/open_api/schema.rb', line 14

def resources
  Resources.load(self)
end

#types{Symbol => Type}

Returns:

  • ({Symbol => Type})


24
25
26
27
28
# File 'app/models/graphiti/open_api/schema.rb', line 24

def types
  __attributes__[:types].each_with_object({}) do |(id, type), result|
    result[id] = Type.new(type.to_hash.merge(name: id))
  end
end