Class: Shhh::App::PrivateKey::Detector

Inherits:
Struct
  • Object
show all
Defined in:
lib/shhh/app/private_key/detector.rb

Overview

:nodoc:s

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.mappingObject (readonly)

Returns the value of attribute mapping


7
8
9
# File 'lib/shhh/app/private_key/detector.rb', line 7

def mapping
  @mapping
end

Instance Attribute Details

#input_handlerObject

Returns the value of attribute input_handler

Returns:

  • (Object)

    the current value of input_handler


4
5
6
# File 'lib/shhh/app/private_key/detector.rb', line 4

def input_handler
  @input_handler
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts


4
5
6
# File 'lib/shhh/app/private_key/detector.rb', line 4

def opts
  @opts
end

Class Method Details

.register(argument, proc) ⇒ Object


9
10
11
# File 'lib/shhh/app/private_key/detector.rb', line 9

def register(argument, proc)
  self.mapping[argument] = proc
end

Instance Method Details

#keyObject


14
15
16
17
18
19
# File 'lib/shhh/app/private_key/detector.rb', line 14

def key
  self.class.mapping.each_pair do |options_key, key_proc|
    return key_proc.call(opts[options_key], self) if opts[options_key]
  end
  nil
end