Class: Dens::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/dens/cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CLI

Returns a new instance of CLI.



4
5
6
7
8
# File 'lib/dens/cli.rb', line 4

def initialize(options = {})
  @origin = options.fetch(:origin)
  @destination = options.fetch(:destination)
  @mover = options.fetch(:mover, Dens::Mover)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



2
3
4
# File 'lib/dens/cli.rb', line 2

def destination
  @destination
end

#moverObject (readonly)

Returns the value of attribute mover.



2
3
4
# File 'lib/dens/cli.rb', line 2

def mover
  @mover
end

#originObject (readonly)

Returns the value of attribute origin.



2
3
4
# File 'lib/dens/cli.rb', line 2

def origin
  @origin
end

Class Method Details

.startObject



14
15
16
# File 'lib/dens/cli.rb', line 14

def self.start
  Dens::CLI.new(origin: ARGV[0], destination: ARGV[1]).start
end

Instance Method Details

#startObject



10
11
12
# File 'lib/dens/cli.rb', line 10

def start
  mover.move(origin, destination)
end