Class: Pocky::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/pocky/package.rb

Constant Summary collapse

DEPENDENCIES_FILENAME =
'package.yml'
DEPRECATED_REFERENCES_FILENAME =
'deprecated_references.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, path:, primary:) ⇒ Package

Returns a new instance of Package.



12
13
14
15
16
17
18
# File 'lib/pocky/package.rb', line 12

def initialize(name:, path:, primary:)
  @name = name
  @path = path
  @primary = primary
  @dependencies = dependencies_yml['dependencies'] || []
  @enforce_privacy = dependencies_yml['enforce_privacy'] || false
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



10
11
12
# File 'lib/pocky/package.rb', line 10

def dependencies
  @dependencies
end

#enforce_privacyObject (readonly)

Returns the value of attribute enforce_privacy.



10
11
12
# File 'lib/pocky/package.rb', line 10

def enforce_privacy
  @enforce_privacy
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/pocky/package.rb', line 10

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



10
11
12
# File 'lib/pocky/package.rb', line 10

def primary
  @primary
end

Instance Method Details

#deprecated_referencesObject



20
21
22
# File 'lib/pocky/package.rb', line 20

def deprecated_references
  @deprecated_references ||= load_yml(deprecated_references_filename)
end