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?, #inferred_project_name, #inferred_stack_name, #project_name_convention, #stack_exists?

Constructor Details

#initialize(name) ⇒ Project

Returns a new instance of Project.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/cody/list/project.rb', line 9

def name
  @name
end

Instance Method Details

#buildObject Also known as: load



14
15
16
17
# File 'lib/cody/list/project.rb', line 14

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

#build_idObject



21
22
23
24
# File 'lib/cody/list/project.rb', line 21

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