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



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

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



68
69
70
# File 'lib/switch_user/user_set.rb', line 68

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