Class: Cody::List::Project
- Inherits:
-
Object
- Object
- Cody::List::Project
- Extended by:
- Memoist
- Includes:
- AwsServices
- Defined in:
- lib/cody/list/project.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #build ⇒ Object (also: #load)
- #build_id ⇒ Object
-
#initialize(name) ⇒ Project
constructor
A new instance of Project.
Methods included from AwsServices
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
#name ⇒ Object (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
#build ⇒ Object 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_id ⇒ Object
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 |