Class: Clyops::ParseResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/clyops.rb

Overview

status is “ok”, “help” or “error”.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, error = "", show_usage = true, detail = []) ⇒ ParseResult

Create a non-exiting parse outcome.

Parameters:

  • status (String) —

    ok, help, or error.

  • error (String) (defaults to: "") —

    failure message.

  • show_usage (Boolean) (defaults to: true) —

    whether help should accompany the error.

  • detail (Array<String>) (defaults to: []) —

    extra failure details.



360
# File 'lib/clyops.rb', line 360

def initialize(status, error = "", show_usage = true, detail = []) = super

Instance Attribute Details

#detail ⇒ Object

Returns the value of attribute detail

Returns:

  • (Object) —

    the current value of detail



354
355
356
# File 'lib/clyops.rb', line 354

def detail
  @detail
end

#error ⇒ Object

Returns the value of attribute error

Returns:

  • (Object) —

    the current value of error



354
355
356
# File 'lib/clyops.rb', line 354

def error
  @error
end

#show_usage ⇒ Object

Returns the value of attribute show_usage

Returns:

  • (Object) —

    the current value of show_usage



354
355
356
# File 'lib/clyops.rb', line 354

def show_usage
  @show_usage
end

#status ⇒ Object

Returns the value of attribute status

Returns:

  • (Object) —

    the current value of status



354
355
356
# File 'lib/clyops.rb', line 354

def status
  @status
end