Exception: BranchIOCLI::Helper::CommandError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/branch_io_cli/helper/methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CommandError

Returns a new instance of CommandError.



5
6
7
8
9
# File 'lib/branch_io_cli/helper/methods.rb', line 5

def initialize(args)
  @args = args[0]
  @status = args[1]
  super message
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/branch_io_cli/helper/methods.rb', line 4

def status
  @status
end

Instance Method Details

#messageObject



11
12
13
14
15
16
17
18
# File 'lib/branch_io_cli/helper/methods.rb', line 11

def message
  if @args.count == 1
    return @args.first.shelljoin if @args.first.kind_of?(Array)
    return @args.first.to_s
  else
    return @args.shelljoin
  end
end