Class: Davidsons::User
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
Methods inherited from Base
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( = {}) requires!(, :username, :password) @options = end |
Instance Method Details
#authenticated? ⇒ 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 |