Class: Starter::Password

Inherits:
String
  • Object
show all
Extended by:
Prompt
Defined in:
lib/starter/password.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Prompt

confirm, prompt

Constructor Details

#initialize(*args) ⇒ Password

Returns a new instance of Password.



18
19
20
# File 'lib/starter/password.rb', line 18

def initialize(*args)
  super
end

Class Method Details

.request(service) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/starter/password.rb', line 7

def self.request(service)
  begin
    system "stty -echo"
    value = prompt "Password for #{service}:"
  ensure
    system "stty echo"
    puts
  end
  self.new(value)
end

Instance Method Details

#inspectObject



22
23
24
# File 'lib/starter/password.rb', line 22

def inspect
  "#<Starter::Password>"
end