Class: SwitchUser::UserSet::Record

Inherits:
Struct
  • Object
show all
Defined in:
lib/switch_user/user_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(user, set) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/switch_user/user_set.rb', line 58

def self.build(user, set)
  id    = user.send(set.identifier)
  label = user.send(set.label)
  scope = set.scope

  new(id, label, scope)
end

Instance Method Details

#scope_idObject



66
67
68
# File 'lib/switch_user/user_set.rb', line 66

def scope_id
  "#{scope}_#{id}"
end