Class: Aspera::Cli::Context
- Inherits:
-
Object
- Object
- Aspera::Cli::Context
- 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
-
#initialize ⇒ nil
constructor
Initialize all members to nil, so that they are defined and can be validated later.
-
#only_manual! ⇒ Symbol
Set the context to manual-only mode.
-
#only_manual? ⇒ Boolean
Check if the context is in manual-only mode.
-
#validate ⇒ nil
Validate that all members are set, raise exception if not.
Constructor Details
#initialize ⇒ nil
Initialize all members to nil, so that they are defined and can be validated later
42 43 44 |
# File 'lib/aspera/cli/main.rb', line 42 def initialize MEMBERS.each{ |i| instance_variable_set(:"@#{i}", nil)} end |
Instance Method Details
#only_manual! ⇒ Symbol
Set the context to manual-only mode
64 65 66 |
# File 'lib/aspera/cli/main.rb', line 64 def only_manual! @transfer = :only_manual end |
#only_manual? ⇒ Boolean
Check if the context is in manual-only mode
58 59 60 |
# File 'lib/aspera/cli/main.rb', line 58 def only_manual? transfer.eql?(:only_manual) end |