Class: Lono::AppFile::Registry::Item
- Inherits:
-
Object
- Object
- Lono::AppFile::Registry::Item
- 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
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, blueprint, options = {}) ⇒ Item
constructor
A new instance of Item.
- #output_path ⇒ Object
- #src_path ⇒ Object
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, ={}) @name, @blueprint, @options = name, blueprint, @type = [:type] || "file" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/lono/app_file/registry/item.rb', line 6 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/lono/app_file/registry/item.rb', line 6 def @options end |
#type ⇒ Object (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_path ⇒ Object
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_path ⇒ Object
12 13 14 |
# File 'lib/lono/app_file/registry/item.rb', line 12 def src_path "#{Lono.blueprint_root}/app/files/#{@name}" end |