Class: OrionWholesale::User
Constant Summary collapse
- USER_DIR =
'/ammoready'
- USER_FILENAME_PREFIX =
'orion_ardy_cust_tab'
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.
7 8 9 10 |
# File 'lib/orion_wholesale/user.rb', line 7 def initialize( = {}) requires!(, :username, :password, :account_id) @options = end |
Instance Method Details
#authenticated? ⇒ Boolean
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/orion_wholesale/user.rb', line 12 def authenticated? tempfile = get_most_recent_file(USER_FILENAME_PREFIX, USER_DIR) File.open(tempfile).each_with_index do |row, i| row = row.split("\t") return true if row[0].strip.downcase == @options[:account_id].strip.downcase end false rescue OrionWholesale::NotAuthenticated false end |