Class: Avm::Stereotypes::EacWebappBase0::Instance

Inherits:
Instances::Base show all
Includes:
Postgresql::InstanceWith
Defined in:
lib/avm/stereotypes/eac_webapp_base0/instance.rb

Constant Summary

Constants inherited from Instances::Base

Instances::Base::ID_PATTERN

Instance Attribute Summary

Attributes inherited from Instances::Base

#application, #suffix

Attributes included from Instances::Base::Dockerizable

#docker_image_options

Instance Method Summary collapse

Methods included from Postgresql::InstanceWith

#pg

Methods inherited from Instances::Base

by_id, #host_env_uncached, #id, #initialize, #to_s

Methods included from Instances::Entries

#full_entry_path, #inherited_entry_value, #other_entry_value, #path_prefix, #read_entry, #read_entry_optional

Methods included from Instances::Base::Dockerizable

#docker_container_exist?, #docker_container_name

Constructor Details

This class inherits a constructor from Avm::Instances::Base

Instance Method Details

#data_dump(argv = []) ⇒ Object



19
20
21
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 19

def data_dump(argv = [])
  run_subcommand(::Avm::Tools::Runner::EacWordpressBase0::Data::Dump, argv)
end

#data_dump_runner_classObject



23
24
25
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 23

def data_dump_runner_class
  "::Avm::Tools::Runner::#{stereotype_name}::Data::Dump".constantize
end

#data_packageObject



32
33
34
35
36
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 32

def data_package
  @data_package ||= ::Avm::Data::Instance::Package.new(
    self, units: { database: database_unit }.merge(files_units)
  )
end

#database_unitObject



38
39
40
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 38

def database_unit
  pg.data_unit
end

#run_subcommand(subcommand_class, argv) ⇒ Object



27
28
29
30
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 27

def run_subcommand(subcommand_class, argv)
  parent = ::OpenStruct.new(instance: self)
  subcommand_class.new(argv: argv, parent: parent).run
end

#stereotype_nameObject



15
16
17
# File 'lib/avm/stereotypes/eac_webapp_base0/instance.rb', line 15

def stereotype_name
  self.class.name.desconstantize.demodulize
end