Class/Module Index [+]

Quicksearch

HammerCLI::Options::Normalizers::Enum

Public Class Methods

new(allowed_values) click to toggle source
# File lib/hammer_cli/options/normalizers.rb, line 126
def initialize(allowed_values)
  @allowed_values = allowed_values
end

Public Instance Methods

complete(value) click to toggle source
# File lib/hammer_cli/options/normalizers.rb, line 142
def complete(value)
  Completer::finalize_completions(@allowed_values)
end
description() click to toggle source
# File lib/hammer_cli/options/normalizers.rb, line 130
def description
  _("One of %s") % quoted_values
end
format(value) click to toggle source
# File lib/hammer_cli/options/normalizers.rb, line 134
def format(value)
  if @allowed_values.include? value
    value
  else
    raise ArgumentError, _("value must be one of '%s'") % quoted_values
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.