Class: Crowbar::Client::App::Batch

Inherits:
Base
  • Object
show all
Defined in:
lib/crowbar/client/app/batch.rb

Overview

A Thor based CLI wrapper for batch commands

Instance Method Summary collapse

Methods inherited from Base

banner, handle_argument_error, #initialize

Constructor Details

This class inherits a constructor from Crowbar::Client::App::Base

Instance Method Details

#export(file = nil) ⇒ String

Batch export command

It will collect the information of the proposals in a YAML format. You can directly provide a path to a file or just pipe the content into stdout. To pipe the content to stdout you should just write a ‘-` instead of a specific filename.

Parameters:

  • file (String) (defaults to: nil)

    the path of the file

Returns:

  • (String)

    a formatted response from the server



70
71
72
73
74
75
76
77
78
# File 'lib/crowbar/client/app/batch.rb', line 70

def export(file = nil)
  Command::Batch::Export.new(
    *command_params(
      file: file
    )
  ).execute
rescue => e
  catch_errors(e)
end