Sha256: 3c711323a1a3bbc00e3d6e99fd43e64d257a44e1bd1574b6ae6e8fd56bdf5dd4
Contents?: true
Size: 1.55 KB
Versions: 1
Compression:
Stored size: 1.55 KB
Contents
# frozen_string_literal: true ## # Represents a tree of method nodes. The tree consists of: # # * a root node; # * method nodes, each of which represents an action in a controller; # * parent nodes attached to one or several method nodes; # # A method node together with its parent nodes represent a complete inheritance chain. # # Nodes::Root # | # Nodes::Parent<ApplicationController> # | # Nodes::Parent<Api::BaseController> # / \ # Nodes::Parent<Api::V1::UsersController> Nodes::Parent<Api::V2::UsersController> # / \ | # Nodes::Method<index> Nodes::Method<show> Nodes::Method<show> # class Rage::OpenAPI::Nodes::Root attr_reader :leaves attr_accessor :version, :title def initialize @parent_nodes_cache = {} @leaves = [] end def parent_nodes @parent_nodes_cache.values end def new_method_node(controller, action, parent_nodes) node = Rage::OpenAPI::Nodes::Method.new(controller, action, parent_nodes) @leaves << node node end def new_parent_node(controller) @parent_nodes_cache[controller] ||= begin node = Rage::OpenAPI::Nodes::Parent.new(self, controller) yield(node) node end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rage-rb-1.11.0 | lib/rage/openapi/nodes/root.rb |