Class: CemAcpt::Platform::Gcp::Project

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/cem_acpt/platform/gcp/compute.rb

Overview

This class represents a GCP project

Instance Method Summary collapse

Methods included from Helper

#add_cmd, #cmd, #cmd_flag_vars?

Constructor Details

#initialize(name: nil, zone: nil) ⇒ Project

Returns a new instance of Project.



25
26
27
28
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 25

def initialize(name: nil, zone: nil)
  @name = name
  @zone = zone
end

Instance Method Details

#cmd_flagObject



38
39
40
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 38

def cmd_flag
  "--project=#{name}"
end

#nameObject



30
31
32
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 30

def name
  @name ||= cmd.project_from_config
end

#zoneObject



34
35
36
# File 'lib/cem_acpt/platform/gcp/compute.rb', line 34

def zone
  @zone ||= cmd.zone_from_config
end