Class: RubyGPG2::Commands::Base
- Inherits:
-
Object
- Object
- RubyGPG2::Commands::Base
- Defined in:
- lib/ruby_gpg2/commands/base.rb
Direct Known Subclasses
Decrypt, Encrypt, Export, ExportSecretKeys, GenerateKey, Import, ListPublicKeys, ListSecretKeys
Instance Method Summary collapse
- #execute(parameters = {}, invocation_options = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 |
# File 'lib/ruby_gpg2/commands/base.rb', line 11 def initialize(opts = {}) @binary = opts[:binary] || RubyGPG2.configuration.binary @stdin = opts[:stdin] || RubyGPG2.configuration.stdin @stdout = opts[:stdout] || RubyGPG2.configuration.stdout @stderr = opts[:stderr] || RubyGPG2.configuration.stderr end |
Instance Method Details
#execute(parameters = {}, invocation_options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ruby_gpg2/commands/base.rb', line 18 def execute(parameters = {}, = {}) parameters = resolve_parameters(parameters) = () do_before(parameters, ) result = do_around(parameters, ) do |p, io| build_and_execute_command(p, io) end result = do_after(result, parameters, ) prepare_result(result, parameters, ) end |