Class: Hanami::CLI::Parser::Result Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/cli/parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments: {}, error: nil, help: false) ⇒ Result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Result.

Since:

  • 0.1.0



104
105
106
107
108
# File 'lib/hanami/cli/parser.rb', line 104

def initialize(arguments: {}, error: nil, help: false)
  @arguments = arguments
  @error     = error
  @help      = help
end

Instance Attribute Details

#argumentsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



96
97
98
# File 'lib/hanami/cli/parser.rb', line 96

def arguments
  @arguments
end

#errorObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



100
101
102
# File 'lib/hanami/cli/parser.rb', line 100

def error
  @error
end

Class Method Details

.failure(error = "Error: Invalid param provided") ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



90
91
92
# File 'lib/hanami/cli/parser.rb', line 90

def self.failure(error = "Error: Invalid param provided")
  new(error: error)
end

.helpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



78
79
80
# File 'lib/hanami/cli/parser.rb', line 78

def self.help
  new(help: true)
end

.success(arguments = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



84
85
86
# File 'lib/hanami/cli/parser.rb', line 84

def self.success(arguments = {})
  new(arguments: arguments)
end

Instance Method Details

#error?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.1.0



112
113
114
# File 'lib/hanami/cli/parser.rb', line 112

def error?
  !error.nil?
end

#help?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.1.0



118
119
120
# File 'lib/hanami/cli/parser.rb', line 118

def help?
  @help
end