Class: Lono::AppFile::Registry::Item

Inherits:
Object
  • Object
show all
Includes:
Utils::Item::FileMethods
Defined in:
lib/lono/app_file/registry/item.rb

Overview

Holds metadata about the item in the regsitry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Item::FileMethods

#directory?, #exist?, #file?, #s3_path, #zip_file_name, #zip_file_path

Constructor Details

#initialize(name, blueprint, options = {}) ⇒ Item

Returns a new instance of Item.



7
8
9
10
# File 'lib/lono/app_file/registry/item.rb', line 7

def initialize(name, blueprint, options={})
  @name, @blueprint, @options = name, blueprint, options
  @type = options[:type] || "file"
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/lono/app_file/registry/item.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/lono/app_file/registry/item.rb', line 6

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/lono/app_file/registry/item.rb', line 6

def type
  @type
end

Instance Method Details

#output_pathObject



16
17
18
19
20
21
22
# File 'lib/lono/app_file/registry/item.rb', line 16

def output_path
  if @type == "file"
    "#{Lono.root}/output/#{@blueprint}/files/#{@name}"
  else
    "#{Lono.root}/output/#{@blueprint}/lambda_layers/#{@name}/opt"
  end
end

#src_pathObject



12
13
14
# File 'lib/lono/app_file/registry/item.rb', line 12

def src_path
  "#{Lono.blueprint_root}/app/files/#{@name}"
end