Class: Solargraph::Environ
- Inherits:
-
Object
- Object
- Solargraph::Environ
- 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
- #domains ⇒ Array<String> readonly
- #pins ⇒ Array<Pin::Reference::Override> readonly
- #requires ⇒ Array<String> readonly
Instance Method Summary collapse
- #clear ⇒ self
-
#initialize(requires: [], domains: [], pins: []) ⇒ Environ
constructor
A new instance of Environ.
- #merge(other) ⇒ self
Constructor Details
#initialize(requires: [], domains: [], pins: []) ⇒ Environ
Returns a new instance of Environ.
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
#domains ⇒ Array<String> (readonly)
14 15 16 |
# File 'lib/solargraph/environ.rb', line 14 def domains @domains end |
#pins ⇒ Array<Pin::Reference::Override> (readonly)
17 18 19 |
# File 'lib/solargraph/environ.rb', line 17 def pins @pins end |
#requires ⇒ Array<String> (readonly)
11 12 13 |
# File 'lib/solargraph/environ.rb', line 11 def requires @requires end |
Instance Method Details
#clear ⇒ 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
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 |