Module: Solargraph::Convention
- Defined in:
- lib/solargraph/convention.rb,
lib/solargraph/convention/base.rb,
lib/solargraph/convention/gemfile.rb,
lib/solargraph/convention/gemspec.rb,
lib/solargraph/convention/rakefile.rb
Overview
Conventions provide a way to modify an ApiMap based on expectations about one of its sources.
Defined Under Namespace
Classes: Base, Gemfile, Gemspec, Rakefile
Constant Summary collapse
- @@conventions =
Set.new
Class Method Summary collapse
- .for_global(object) ⇒ Environ
- .for_local(source_map) ⇒ Environ
-
.for_object(api_map, rooted_tag, scope, visibility, deep, skip, no_core) ⇒ Environ
Provides any additional method pins based on the described object.
- .register(convention) ⇒ void
- .unregister(convention) ⇒ void
Class Method Details
.for_global(object) ⇒ Environ
TODO:
Determine what argument needs to be passed here
42 43 44 45 46 47 48 |
# File 'lib/solargraph/convention.rb', line 42 def self.for_global object result = Environ.new @@conventions.each do |conv| result.merge conv.global(object) end result end |
.for_local(source_map) ⇒ Environ
30 31 32 33 34 35 36 |
# File 'lib/solargraph/convention.rb', line 30 def self.for_local source_map result = Environ.new @@conventions.each do |conv| result.merge conv.local(source_map) end result end |
.for_object(api_map, rooted_tag, scope, visibility, deep, skip, no_core) ⇒ Environ
Provides any additional method pins based on the described object.
62 63 64 65 66 67 68 69 70 |
# File 'lib/solargraph/convention.rb', line 62 def self.for_object api_map, rooted_tag, scope, visibility, deep, skip, no_core result = Environ.new @@conventions.each do |conv| result.merge conv.object(api_map, rooted_tag, scope, visibility, deep, skip, no_core) end result end |
.register(convention) ⇒ void
This method returns an undefined value.
18 19 20 |
# File 'lib/solargraph/convention.rb', line 18 def self.register convention @@conventions.add convention.new end |
.unregister(convention) ⇒ void
This method returns an undefined value.
24 25 26 |
# File 'lib/solargraph/convention.rb', line 24 def self.unregister convention @@conventions.delete_if { |c| c.is_a?(convention) } end |