Class: Cliqr::Command::ArgumentOperator Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cliqr/command/argument_operator.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.

Operates on the value of a argument after it has been validated

Direct Known Subclasses

NumericArgumentOperator

Constant Summary collapse

DEFAULT_ARGUMENT_OPERATOR =

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

Default pass through argument operator

ArgumentOperator.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for_type(type) ⇒ Cliqr::CLI::ArgumentOperator

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.

Get a new ArgumentOperator for a argument type

Returns:

  • (Cliqr::CLI::ArgumentOperator)


15
16
17
18
19
20
21
22
# File 'lib/cliqr/command/argument_operator.rb', line 15

def self.for_type(type)
  case type
  when Config::NUMERIC_ARGUMENT_TYPE
    NumericArgumentOperator.new
  else
    DEFAULT_ARGUMENT_OPERATOR
  end
end

Instance Method Details

#operate(value) ⇒ String

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.

Return the same value back without any change

Returns:

  • (String)


27
28
29
# File 'lib/cliqr/command/argument_operator.rb', line 27

def operate(value)
  value
end