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

Overview

Conventions provide a way to modify an ApiMap based on expectations about one of its sources.

Defined Under Namespace

Classes: Base, Gemfile, Gemspec, Rspec

Constant Summary collapse

@@conventions =
Set.new

Class Method Summary collapse

Class Method Details

.for_global(yard_map) ⇒ Environ

Parameters:

Returns:



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

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:



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

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:



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

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