Class: RsrGroup::User
Constant Summary
Constants inherited from Base
Base::DEFAULT_CATALOG_FILENAME, Base::DEFAULT_DIR, Base::KEYDEALER_CATALOG_FILENAME, Base::KEYDEALER_DIR, Base::MAP_FILENAME, Base::QTY_FILENAME
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 |
# File 'lib/rsr_group/user.rb', line 4 def initialize( = {}) requires!(, :username, :password) = end |
Instance Method Details
#authenticated? ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rsr_group/user.rb', line 9 def authenticated? connect() do |ftp| ftp.status ftp.close end return true rescue RsrGroup::NotAuthenticated false rescue Net::FTPPermError => e if e. =~ /authentication failed/i return false else raise e end end |