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


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

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


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

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


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

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


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

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


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

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


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

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.

Since:

  • 0.1.0


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

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.

Since:

  • 0.1.0


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

def help?
  @help
end