Class: LearnOpen::DependencyInstallers::BaseInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/learn_open/services/dependency_installers/base_installer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, options)
  @lesson = lesson
  @location = location
  @environment = environment
  @system_adapter = options.fetch(:system_adapter, LearnOpen.system_adapter)
  @io = options.fetch(:io, LearnOpen.default_io)
end

Instance Attribute Details

#environmentObject (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

#ioObject (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

#lessonObject (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

#locationObject (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_adapterObject (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, options)
  if self.detect(lesson, location)
    self.new(lesson, location, environment, options).run
  end
end