Module: Solargraph::Convention

Defined in:
lib/solargraph/convention.rb,
lib/solargraph/convention/base.rb,
lib/solargraph/convention/rspec.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, Rspec

Constant Summary collapse

@@conventions =
Set.new

Class Method Summary collapse

Class Method Details

.for_global(yard_map) ⇒ Environ

Parameters:

Returns:



36
37
38
39
40
41
42
# File 'lib/solargraph/convention.rb', line 36

def self.for_global(yard_map)
  result = Environ.new
  @@conventions.each do |conv|
    result.merge conv.global(yard_map)
  end
  result
end

.for_local(source_map) ⇒ Environ

Parameters:

Returns:



26
27
28
29
30
31
32
# File 'lib/solargraph/convention.rb', line 26

def self.for_local(source_map)
  result = Environ.new
  @@conventions.each do |conv|
    result.merge conv.local(source_map)
  end
  result
end

.register(convention) ⇒ void

This method returns an undefined value.

Parameters:



20
21
22
# File 'lib/solargraph/convention.rb', line 20

def self.register convention
  @@conventions.add convention.new
end