Class: Commands::Init::DepotModel

Inherits:
InitModel
  • Object
show all
Includes:
P4Helpers
Defined in:
lib/commands/init/depot_model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from P4Helpers

#open_client

Methods inherited from InitModel

inheritable_attributes, inherited, #rank, run

Constructor Details

#initializeDepotModel

Returns a new instance of DepotModel.



37
38
39
40
41
42
43
44
45
# File 'lib/commands/init/depot_model.rb', line 37

def initialize
  @depot = self.class.depot
  @description = self.class.description
  @type = self.class.type
  @address = self.class.address
  @suffix = self.class.suffix
  @map = self.class.map
  @spec_map = self.class.spec_map
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def address
  @address
end

#depotObject

Returns the value of attribute depot.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def depot
  @depot
end

#descriptionObject

Returns the value of attribute description.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def description
  @description
end

#mapObject

Returns the value of attribute map.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def map
  @map
end

#spec_mapObject

Returns the value of attribute spec_map.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def spec_map
  @spec_map
end

#suffixObject

Returns the value of attribute suffix.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def suffix
  @suffix
end

#typeObject

Returns the value of attribute type.



35
36
37
# File 'lib/commands/init/depot_model.rb', line 35

def type
  @type
end

Class Method Details

.abstractObject

Internal implementation



31
32
33
# File 'lib/commands/init/depot_model.rb', line 31

def self.abstract
  true
end

Instance Method Details

#execute(p4, models = nil, super_user = nil) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/commands/init/depot_model.rb', line 47

def execute(p4, models=nil, super_user=nil)
  d = p4.fetch_depot(depot)
  d._depot = depot
  d._description = description if description
  d._type = type if type
  d._address = address if address
  d._suffix = suffix if suffix
  d._map = map if map
  d._spec_map = spec_map if spec_map
  p4.save_depot(d)
end