Class: BillHicks::User

Inherits:
Base
  • Object
show all
Defined in:
lib/bill_hicks/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
# File 'lib/bill_hicks/user.rb', line 4

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

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
# File 'lib/bill_hicks/user.rb', line 9

def authenticated?
  connect(@options) { |ftp| ftp.pwd }
  true
rescue BillHicks::NotAuthenticated
  false
end