Class: Cody::List::Project

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
AwsServices
Defined in:
lib/cody/list/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AwsServices

#cfn, #codebuild

Methods included from AwsServices::Helpers

#are_you_sure?, #find_stack, #inferred_project_name, #inferred_stack_name, #normalize_stack_name, #project_name_convention, #stack_exists?

Constructor Details

#initialize(name) ⇒ Project

Returns a new instance of Project.



12
13
14
# File 'lib/cody/list/project.rb', line 12

def initialize(name)
  @name = name # Simple string
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/cody/list/project.rb', line 11

def name
  @name
end

Instance Method Details

#buildObject Also known as: load



16
17
18
19
20
# File 'lib/cody/list/project.rb', line 16

def build
  return NoBuildsProject.new unless build_id # most recent build
  resp = codebuild.batch_get_builds(ids: [build_id])
  resp.builds.first
end

#build_idObject



24
25
26
27
# File 'lib/cody/list/project.rb', line 24

def build_id
  resp = codebuild.list_builds_for_project(project_name: @name)
  resp.ids.first # most recent build_id
end