Class: Terraspace::Mod::Remote

Inherits:
Terraspace::Mod show all
Defined in:
lib/terraspace/mod/remote.rb

Instance Attribute Summary

Attributes inherited from Terraspace::Mod

#consider_stacks, #instance, #name, #options, #resolved, #root_module

Instance Method Summary collapse

Methods inherited from Terraspace::Mod

#build_dir, #cache_dir, #check_exist!, #exist?, #expansion, #out_option, #placeholder, #possible_fake_root, #root_module?, #to_info, #type_dir

Methods included from Util::Pretty

#pretty_path, #pretty_time

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

#initialize(meta, parent) ⇒ Remote

Returns a new instance of Remote.



3
4
5
6
7
8
# File 'lib/terraspace/mod/remote.rb', line 3

def initialize(meta, parent)
  # meta: from .terraform/modules/modules.json. Example structure: spec/fixtures/initialized/modules.json
  # parent: parent module or stack. IE: terraspace build MOD
  @meta, @parent  = meta, parent
  @name = @meta['Key']
end

Instance Method Details

#rootObject



10
11
12
# File 'lib/terraspace/mod/remote.rb', line 10

def root
  "#{@parent.cache_dir}/#{@meta['Dir']}"
end

#typeObject



14
15
16
# File 'lib/terraspace/mod/remote.rb', line 14

def type
  "module"
end