Class: CcSecureInput

Inherits:
FlexCocoa show all
Defined in:
lib/flex_cocoa/cc_secure_input.rb

Instance Attribute Summary

Attributes inherited from FlexCocoa

#exec, #output

Instance Method Summary collapse

Methods inherited from FlexCocoa

#button_response, #buttons_template, #parts_init, #post_initialize, set_path

Constructor Details

#initialize(title, question, prompt = '', cancel = false) ⇒ CcSecureInput

Returns a new instance of CcSecureInput.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/flex_cocoa/cc_secure_input.rb', line 9

def initialize (title, question, prompt = '', cancel = false)
  super()

  if cancel
    buttons_template('inputbox', title, prompt, question, 'Cancel', 'Ok', nil)
  else
    buttons_template('inputbox', title, prompt, question, 'Ok', nil, nil)
  end

  @exec << " --no-show"
  post_initialize
  response = @stdout.read.strip.split("\n")
  @output = {button: response[0], response: response[1]}
end