module Solargraph::Convention

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

Public Class Methods

for_global(yard_map) click to toggle source

@param yard_map [YardMap] @return [Environ]

# File lib/solargraph/convention.rb, line 34
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) click to toggle source

@param source_map [SourceMap] @return [Environ]

# File lib/solargraph/convention.rb, line 24
def self.for_local(source_map)
  result = Environ.new
  @@conventions.each do |conv|
    result.merge conv.local(source_map)
  end
  result
end
register(convention) click to toggle source

@param convention [Class<Convention::Base>] @return [void]

# File lib/solargraph/convention.rb, line 18
def self.register convention
  @@conventions.add convention.new
end