Class: SqAuth::SqAuthUser::BasicUser

Inherits:
Object
  • Object
show all
Defined in:
lib/sq_auth/sq_auth_user/basic_user.rb

Direct Known Subclasses

RackUser

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#user_ipObject

Returns the value of attribute user_ip.



4
5
6
# File 'lib/sq_auth/sq_auth_user/basic_user.rb', line 4

def user_ip
  @user_ip
end

#user_nameObject

Returns the value of attribute user_name.



4
5
6
# File 'lib/sq_auth/sq_auth_user/basic_user.rb', line 4

def user_name
  @user_name
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/sq_auth/sq_auth_user/basic_user.rb', line 9

def [] key
  {name: (user_name || "Anonymous"), ip: (user_ip || "127.0.0.1")}[key]
end

#current_userObject



5
6
7
# File 'lib/sq_auth/sq_auth_user/basic_user.rb', line 5

def current_user
  self
end