Class: PuppetDBCLI::AnonymizationTransformer

Inherits:
Object
  • Object
show all
Defined in:
lib/puppetdb_cli/db/export.rb

Overview

Transform and validate a String into a keyword anonymization profile

Instance Method Summary collapse

Instance Method Details

#call(str) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
# File 'lib/puppetdb_cli/db/export.rb', line 10

def call(str)
  raise ArgumentError unless str.is_a? String

  str.to_sym.tap do |symbol|
    raise unless %i[none low moderate full].include?(symbol)
  end
end