Module: CanTango::Api::Masquerade::Account

Defined in:
lib/cantango/masquerade/api/masquerade/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#active_accountObject (readonly)

Returns the value of attribute active_account.



5
6
7
# File 'lib/cantango/masquerade/api/masquerade/account.rb', line 5

def 
  @active_account
end

#masqueradingObject (readonly)

Returns the value of attribute masquerading.



5
6
7
# File 'lib/cantango/masquerade/api/masquerade/account.rb', line 5

def masquerading
  @masquerading
end

Instance Method Details

#masquerade_as(account) ⇒ Object



7
8
9
10
11
# File 'lib/cantango/masquerade/api/masquerade/account.rb', line 7

def masquerade_as 
  raise "Must be a registered type of account, was: #{}" unless valid_account? 
  @masquerading = true
  @active_account = 
end

#masquerading?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/cantango/masquerade/api/masquerade/account.rb', line 17

def masquerading?
  !@masquerading.nil?
end

#stop_masqueradeObject



13
14
15
# File 'lib/cantango/masquerade/api/masquerade/account.rb', line 13

def stop_masquerade
  @active_account, @masquerading = nil, nil
end