Class: Dapp::Dimg::Builder::Chef::CookbookMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/dimg/builder/chef/cookbook_metadata.rb

Defined Under Namespace

Classes: Builder, FromConfBuilder, FromFileBuilder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#builderObject

Returns the value of attribute builder.



4
5
6
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 4

def builder
  @builder
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 5

def name
  @name
end

#versionObject

Returns the value of attribute version.



6
7
8
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 6

def version
  @version
end

Class Method Details

.from_conf(name:, version:, cookbooks:) ⇒ Object



23
24
25
26
27
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 23

def from_conf(name:, version:, cookbooks:)
  new.tap do ||
    .builder = FromConfBuilder.new(, name, version, cookbooks)
  end
end

.from_file(metadata_file_path:) ⇒ Object



17
18
19
20
21
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 17

def from_file(metadata_file_path:)
  new.tap do ||
    .builder = FromFileBuilder.new(, )
  end
end

Instance Method Details

#dependsObject



8
9
10
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 8

def depends
  @depends ||= {}
end

#dumpObject



12
13
14
# File 'lib/dapp/dimg/builder/chef/cookbook_metadata.rb', line 12

def dump
  builder.send(:dump) # "friend class"
end