Class: ICloudReaderCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/icloud-reader.rb

Instance Method Summary collapse

Instance Method Details

#ask_for_passwordObject



114
115
116
# File 'lib/icloud-reader.rb', line 114

def ask_for_password
  asker.ask("Password (will be masked with x's): ")  { |q| q.echo = "x" }   
end

#ask_for_usernameObject



110
111
112
# File 'lib/icloud-reader.rb', line 110

def ask_for_username
  asker.ask("Username: ")
end

#askerObject



106
107
108
# File 'lib/icloud-reader.rb', line 106

def asker
  HighLine.new
end

#readerObject



97
98
99
100
101
102
103
104
# File 'lib/icloud-reader.rb', line 97

def reader
  unless @reader
    username = ask_for_username
    password = ask_for_password
    @reader = ICloudReader.new(:server_number => server_number, :username => username, :password => password)
  end
  @reader
end