Class: GitWit::Actions::Etc::User

Inherits:
Base
  • Object
show all
Defined in:
lib/git_wit/actions/etc/user.rb

Instance Attribute Summary

Attributes inherited from Base

#base, #name, #type

Instance Method Summary collapse

Methods inherited from Base

#exists?

Constructor Details

#initialize(base, name, home, config = {}) ⇒ User

Returns a new instance of User.



3
4
5
6
# File 'lib/git_wit/actions/etc/user.rb', line 3

def initialize(base, name, home, config = {})
  super base, :user, name, config
  @home = home
end

Instance Method Details

#invoke!Object



8
9
10
11
12
13
# File 'lib/git_wit/actions/etc/user.rb', line 8

def invoke!
  invoke_with_conflict_check do
    create
  end
  home
end

#revoke!Object



15
16
17
18
19
# File 'lib/git_wit/actions/etc/user.rb', line 15

def revoke!
  say_status :remove, :red
  destroy if !pretend? && exists?
  home
end