Class: CircleCI::Project
- Inherits:
-
Object
- Object
- CircleCI::Project
- Defined in:
- lib/mina-circle/circle-ci/project.rb
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
writeonly
Sets the attribute artifacts.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#vcs_type ⇒ Object
readonly
Returns the value of attribute vcs_type.
Instance Method Summary collapse
- #build_path ⇒ Object
-
#initialize(organization:, name:, vcs_type: 'github') ⇒ Project
constructor
A new instance of Project.
- #recent_builds(branch) ⇒ Object
Constructor Details
#initialize(organization:, name:, vcs_type: 'github') ⇒ Project
Returns a new instance of Project.
4 5 6 7 8 |
# File 'lib/mina-circle/circle-ci/project.rb', line 4 def initialize(organization:, name:, vcs_type: 'github') @organization = organization @name = name @vcs_type = vcs_type end |
Instance Attribute Details
#artifacts=(value) ⇒ Object (writeonly)
Sets the attribute artifacts
2 3 4 |
# File 'lib/mina-circle/circle-ci/project.rb', line 2 def artifacts=(value) @artifacts = value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mina-circle/circle-ci/project.rb', line 3 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
3 4 5 |
# File 'lib/mina-circle/circle-ci/project.rb', line 3 def organization @organization end |
#vcs_type ⇒ Object (readonly)
Returns the value of attribute vcs_type.
3 4 5 |
# File 'lib/mina-circle/circle-ci/project.rb', line 3 def vcs_type @vcs_type end |
Instance Method Details
#build_path ⇒ Object
10 11 12 13 14 |
# File 'lib/mina-circle/circle-ci/project.rb', line 10 def build_path parts = api_path_parts + ['tree', real_branch] parts.compact.join('/') end |
#recent_builds(branch) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/mina-circle/circle-ci/project.rb', line 16 def recent_builds(branch) client = CircleCI::Client.instance path = api_path branch response = client.get path builds = response.collect { |build| CircleCI::Build.new(build, self) } builds.compact end |