Class: LearnOpen::DependencyInstallers::BaseInstaller
- Inherits:
-
Object
- Object
- LearnOpen::DependencyInstallers::BaseInstaller
- Defined in:
- lib/learn_open/services/dependency_installers/base_installer.rb
Direct Known Subclasses
GemInstaller, JupyterPipInstall, NodeInstaller, PipInstaller
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#lesson ⇒ Object
readonly
Returns the value of attribute lesson.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#system_adapter ⇒ Object
readonly
Returns the value of attribute system_adapter.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(lesson, location, environment, options) ⇒ BaseInstaller
constructor
A new instance of BaseInstaller.
Constructor Details
#initialize(lesson, location, environment, options) ⇒ BaseInstaller
Returns a new instance of BaseInstaller.
12 13 14 15 16 17 18 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 12 def initialize(lesson, location, environment, ) @lesson = lesson @location = location @environment = environment @system_adapter = .fetch(:system_adapter, LearnOpen.system_adapter) @io = .fetch(:io, LearnOpen.default_io) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
4 5 6 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 4 def environment @environment end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
4 5 6 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 4 def io @io end |
#lesson ⇒ Object (readonly)
Returns the value of attribute lesson.
4 5 6 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 4 def lesson @lesson end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 4 def location @location end |
#system_adapter ⇒ Object (readonly)
Returns the value of attribute system_adapter.
4 5 6 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 4 def system_adapter @system_adapter end |
Class Method Details
.call(lesson, location, environment, options) ⇒ Object
6 7 8 9 10 |
# File 'lib/learn_open/services/dependency_installers/base_installer.rb', line 6 def self.call(lesson, location, environment, ) if self.detect(lesson, location) self.new(lesson, location, environment, ).run end end |