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::Base> readonly
- #requires ⇒ Array<String> readonly
- #yard_plugins ⇒ Array<String> readonly
Instance Method Summary collapse
- #clear ⇒ self
-
#initialize(requires: [], domains: [], pins: [], yard_plugins: []) ⇒ Environ
constructor
A new instance of Environ.
- #merge(other) ⇒ self
Constructor Details
#initialize(requires: [], domains: [], pins: [], yard_plugins: []) ⇒ Environ
Returns a new instance of Environ.
26 27 28 29 30 31 |
# File 'lib/solargraph/environ.rb', line 26 def initialize requires: [], domains: [], pins: [], yard_plugins: [] @requires = requires @domains = domains @pins = pins @yard_plugins = yard_plugins 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::Base> (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 |
#yard_plugins ⇒ Array<String> (readonly)
20 21 22 |
# File 'lib/solargraph/environ.rb', line 20 def yard_plugins @yard_plugins end |
Instance Method Details
#clear ⇒ self
34 35 36 37 38 39 40 |
# File 'lib/solargraph/environ.rb', line 34 def clear domains.clear requires.clear pins.clear yard_plugins.clear self end |
#merge(other) ⇒ self
44 45 46 47 48 49 50 |
# File 'lib/solargraph/environ.rb', line 44 def merge other domains.concat other.domains requires.concat other.requires pins.concat other.pins yard_plugins.concat other.yard_plugins self end |