Class: DocsKit::OpenApi::Schema::Cursor
- Inherits:
-
Data
- Object
- Data
- DocsKit::OpenApi::Schema::Cursor
- Defined in:
- lib/docs_kit/open_api/schema.rb
Overview
The recursion state threaded through property flattening: the dotted-name prefix, the current depth, and the $ref chain seen so far (for cycles).
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#seen ⇒ Object
readonly
Returns the value of attribute seen.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth
36 37 38 |
# File 'lib/docs_kit/open_api/schema.rb', line 36 def depth @depth end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix
36 37 38 |
# File 'lib/docs_kit/open_api/schema.rb', line 36 def prefix @prefix end |
#seen ⇒ Object (readonly)
Returns the value of attribute seen
36 37 38 |
# File 'lib/docs_kit/open_api/schema.rb', line 36 def seen @seen end |
Class Method Details
.root ⇒ Object
37 |
# File 'lib/docs_kit/open_api/schema.rb', line 37 def self.root = new(prefix: "", depth: 0, seen: []) |
Instance Method Details
#descend(name, ref) ⇒ Object
38 |
# File 'lib/docs_kit/open_api/schema.rb', line 38 def descend(name, ref) = self.class.new(prefix: name, depth: depth + 1, seen: seen + [ref].compact) |
#dotted(name) ⇒ Object
39 |
# File 'lib/docs_kit/open_api/schema.rb', line 39 def dotted(name) = prefix.empty? ? name : "#{prefix}.#{name}" |