Class: Davidsons::User

Inherits:
Base
  • Object
show all
Defined in:
lib/davidsons/user.rb

Instance Method Summary collapse

Methods inherited from Base

connect

Constructor Details

#initialize(options = {}) ⇒ User

Returns a new instance of User.



4
5
6
7
8
# File 'lib/davidsons/user.rb', line 4

def initialize(options = {})
  requires!(options, :username, :password)

  @options = options
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
# File 'lib/davidsons/user.rb', line 10

def authenticated?
  connect(@options) { |ftp| ftp.pwd }
  true
rescue Davidsons::NotAuthenticated => e
  puts "Davidsons::User#authenticated? => false"
  puts e
  false
end