Class: Commands::Init::GroupModel
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from InitModel
inheritable_attributes, inherited, #rank, run
Constructor Details
Returns a new instance of GroupModel.
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/commands/init/group_model.rb', line 25
def initialize
@group = self.class.group
@max_results = self.class.max_results
@max_scan_rows = self.class.max_scan_rows
@timeout = self.class.timeout
@password_timeout = self.class.password_timeout
@users = self.class.users
@subgroups = self.class.subgroups
@owners = self.class.owners
end
|
Class Method Details
.abstract ⇒ Object
21
22
23
|
# File 'lib/commands/init/group_model.rb', line 21
def self.abstract
true
end
|
Instance Method Details
#execute(p4, models = nil, super_user = nil) ⇒ Object
53
54
55
56
|
# File 'lib/commands/init/group_model.rb', line 53
def execute(p4, models=nil, super_user=nil)
puts "group: #{to_spec}"
p4.save_group(to_spec)
end
|
#to_spec ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/commands/init/group_model.rb', line 36
def to_spec
spec = {
'Group' => @group
}
spec['MaxResults'] = @max_results unless @max_results.nil?
spec['MaxScanRows'] = @max_scan_rows unless @max_scan_rows.nil?
spec['MaxLockTime'] = @max_lock_time unless @max_lock_time.nil?
spec['Timeout'] = @timeout unless @timeout.nil?
spec['PasswordTimeout'] = @password_timeout unless @password_timeout.nil?
spec['Users'] = @users unless @users.nil?
spec['Subgroups'] = @subgroups unless @subgroups.nil?
spec['Owners'] = @owners unless @owners.nil?
spec
end
|