Class: Solargraph::ApiMap::Index
- Inherits:
-
Object
- Object
- Solargraph::ApiMap::Index
- Defined in:
- lib/solargraph/api_map/index.rb
Instance Attribute Summary collapse
- #extend_references ⇒ Hash{String => Array<Pin::Reference::Extend>} readonly
- #include_references ⇒ Hash{String => Array<Pin::Reference::Include>} readonly
- #namespace_hash ⇒ Hash{String => Array<Pin::Namespace>} readonly
- #path_pin_hash ⇒ Hash{String => Array<Pin::Base>} readonly
- #pin_class_hash ⇒ Hash{String => Array<Pin::Base>} readonly
- #pins ⇒ Array<Pin::Base> readonly
- #prepend_references ⇒ Hash{String => Array<Pin::Reference::Prepend>} readonly
- #superclass_references ⇒ Hash{String => Array<Pin::Reference::Superclass>} readonly
Instance Method Summary collapse
-
#initialize(pins = []) ⇒ Index
constructor
A new instance of Index.
- #merge(pins) ⇒ Object
- #pins_by_class(klass) ⇒ Set<generic<T>>
Constructor Details
#initialize(pins = []) ⇒ Index
Returns a new instance of Index.
7 8 9 |
# File 'lib/solargraph/api_map/index.rb', line 7 def initialize pins = [] catalog pins end |
Instance Attribute Details
#extend_references ⇒ Hash{String => Array<Pin::Reference::Extend>}
46 47 48 |
# File 'lib/solargraph/api_map/index.rb', line 46 def extend_references @extend_references ||= Hash.new { |h, k| h[k] = [] } end |
#include_references ⇒ Hash{String => Array<Pin::Reference::Include>}
41 42 43 |
# File 'lib/solargraph/api_map/index.rb', line 41 def include_references @include_references ||= Hash.new { |h, k| h[k] = [] } end |
#namespace_hash ⇒ Hash{String => Array<Pin::Namespace>}
17 18 19 |
# File 'lib/solargraph/api_map/index.rb', line 17 def namespace_hash @namespace_hash ||= Hash.new { |h, k| h[k] = [] } end |
#path_pin_hash ⇒ Hash{String => Array<Pin::Base>}
27 28 29 |
# File 'lib/solargraph/api_map/index.rb', line 27 def path_pin_hash @path_pin_hash ||= Hash.new { |h, k| h[k] = [] } end |
#pin_class_hash ⇒ Hash{String => Array<Pin::Base>}
22 23 24 |
# File 'lib/solargraph/api_map/index.rb', line 22 def pin_class_hash @pin_class_hash ||= Hash.new { |h, k| h[k] = [] } end |
#pins ⇒ Array<Pin::Base>
12 13 14 |
# File 'lib/solargraph/api_map/index.rb', line 12 def pins @pins ||= [] end |
#prepend_references ⇒ Hash{String => Array<Pin::Reference::Prepend>}
51 52 53 |
# File 'lib/solargraph/api_map/index.rb', line 51 def prepend_references @prepend_references ||= Hash.new { |h, k| h[k] = [] } end |
#superclass_references ⇒ Hash{String => Array<Pin::Reference::Superclass>}
56 57 58 |
# File 'lib/solargraph/api_map/index.rb', line 56 def superclass_references @superclass_references ||= Hash.new { |h, k| h[k] = [] } end |
Instance Method Details
#merge(pins) ⇒ Object
61 62 63 |
# File 'lib/solargraph/api_map/index.rb', line 61 def merge pins deep_clone.catalog pins end |
#pins_by_class(klass) ⇒ Set<generic<T>>
34 35 36 37 38 |
# File 'lib/solargraph/api_map/index.rb', line 34 def pins_by_class klass # @type [Set<Solargraph::Pin::Base>] s = Set.new @pin_select_cache[klass] ||= pin_class_hash.each_with_object(s) { |(key, o), n| n.merge(o) if key <= klass } end |