Class: Bosh::Director::Models::Package
- Defined in:
- lib/bosh/director/models/package.rb
Instance Method Summary collapse
-
#dependency_set ⇒ Set<String>
A set of package names this package depends on.
- #dependency_set=(deps) ⇒ Object
- #desc ⇒ Object
- #validate ⇒ Object
Instance Method Details
#dependency_set ⇒ Set<String>
Returns A set of package names this package depends on.
10 11 12 13 14 |
# File 'lib/bosh/director/models/package.rb', line 10 def dependency_set json = self.dependency_set_json ::Set.new(json ? JSON.parse(json) : nil) end |
#dependency_set=(deps) ⇒ Object
16 17 18 |
# File 'lib/bosh/director/models/package.rb', line 16 def dependency_set=(deps) self.dependency_set_json = JSON.generate(deps.to_a) end |
#desc ⇒ Object
30 31 32 |
# File 'lib/bosh/director/models/package.rb', line 30 def desc "#{name}/#{version}" end |
#validate ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/bosh/director/models/package.rb', line 20 def validate if !sha1.nil? || !blobstore_id.nil? validates_presence [:sha1, :blobstore_id] end validates_presence [:release_id, :name, :version] validates_unique [:release_id, :name, :version] validates_format VALID_ID, [:name, :version] end |