Class: Netscaler::Executor
- Inherits:
-
Object
- Object
- Netscaler::Executor
- Defined in:
- lib/netscaler/executor.rb
Instance Method Summary collapse
- #execute!(args, options) ⇒ Object
-
#initialize(request_class) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(request_class) ⇒ Executor
Returns a new instance of Executor.
9 10 11 |
# File 'lib/netscaler/executor.rb', line 9 def initialize(request_class) @request_class = request_class end |
Instance Method Details
#execute!(args, options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/netscaler/executor.rb', line 13 def execute!(args, ) Netscaler::Logging.configure([:debug]) Netscaler::Transaction.new [:netscaler] do |client| @request_class.new(client).send([:action], args[0], ) do |response| if [:json] puts JSON.pretty_generate(response) else STDERR.puts "Tempoararily disabled stdout. Use --json instead. Sorry...." # puts Hirb::Helpers::Tree.render(response) end end end end |