Class: Solargraph::Environ

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/environ.rb

Overview

A collection of additional data, such as map pins and required paths, that can be added to an ApiMap.

Conventions are used to add Environs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(requires: [], domains: [], pins: []) ⇒ Environ

Returns a new instance of Environ.

Parameters:

  • requires (Array<String>) (defaults to: [])
  • domains (Array<String>) (defaults to: [])
  • pins (Array<Pin::Base>) (defaults to: [])


22
23
24
25
26
# File 'lib/solargraph/environ.rb', line 22

def initialize requires: [], domains: [], pins: []
  @requires = requires
  @domains = domains
  @pins = pins
end

Instance Attribute Details

#domainsArray<String> (readonly)

Returns:

  • (Array<String>)


14
15
16
# File 'lib/solargraph/environ.rb', line 14

def domains
  @domains
end

#pinsArray<Pin::Reference::Override> (readonly)

Returns:



17
18
19
# File 'lib/solargraph/environ.rb', line 17

def pins
  @pins
end

#requiresArray<String> (readonly)

Returns:

  • (Array<String>)


11
12
13
# File 'lib/solargraph/environ.rb', line 11

def requires
  @requires
end

Instance Method Details

#clearself

Returns:

  • (self)


29
30
31
32
33
34
# File 'lib/solargraph/environ.rb', line 29

def clear
  domains.clear
  requires.clear
  pins.clear
  self
end

#merge(other) ⇒ self

Parameters:

Returns:

  • (self)


38
39
40
41
42
43
# File 'lib/solargraph/environ.rb', line 38

def merge other
  domains.concat other.domains
  requires.concat other.requires
  pins.concat other.pins
  self
end