Class: Aspera::Cli::Context

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

Overview

Global objects shared with plugins

Constant Summary collapse

MEMBERS =
%i[options transfer config formatter persistency man_header].freeze

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



23
24
25
# File 'lib/aspera/cli/main.rb', line 23

def initialize
  @man_header = true
end

Instance Method Details

#only_manualObject



38
39
40
# File 'lib/aspera/cli/main.rb', line 38

def only_manual
  @transfer = :only_manual
end

#only_manual?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/aspera/cli/main.rb', line 34

def only_manual?
  transfer.eql?(:only_manual)
end

#validateObject



27
28
29
30
31
32
# File 'lib/aspera/cli/main.rb', line 27

def validate
  MEMBERS.each do |i|
    Aspera.assert(instance_variable_defined?(:"@#{i}"))
    Aspera.assert(!instance_variable_get(:"@#{i}").nil?)
  end
end