Module: CatchNotes::AuthItems::ClassMethods

Defined in:
lib/catch_notes/module/auth_items.rb

Instance Method Summary collapse

Instance Method Details

#password(password) ⇒ Object



9
10
11
# File 'lib/catch_notes/module/auth_items.rb', line 9

def password( password )
  send(:basic_auth, get_auth[:username] || '', password)
end

#username(username) ⇒ Object



5
6
7
# File 'lib/catch_notes/module/auth_items.rb', line 5

def username( username )
  send(:basic_auth, username, get_auth[:password] || '')
end

#valid_password?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/catch_notes/module/auth_items.rb', line 18

def valid_password?
  password = get_auth[:password]
  !(password.nil? || password == '')
end

#valid_username?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/catch_notes/module/auth_items.rb', line 13

def valid_username?
  username = get_auth[:username]
  !(username.nil? || username == '')
end