Class: CircleCI::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/mina-circle/circle-ci/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organization:, name:, branch:, vcs_type: 'github') ⇒ Project

Returns a new instance of Project.



4
5
6
7
8
9
# File 'lib/mina-circle/circle-ci/project.rb', line 4

def initialize(organization:, name:, branch:, vcs_type: 'github')
  @organization = organization
  @name = name
  @vcs_type = vcs_type
  @branch = branch
end

Instance Attribute Details

#artifactsObject



11
12
13
# File 'lib/mina-circle/circle-ci/project.rb', line 11

def artifacts
  @artifacts ||= fetch_artifacts
end

#branchObject (readonly)

Returns the value of attribute branch.



3
4
5
# File 'lib/mina-circle/circle-ci/project.rb', line 3

def branch
  @branch
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/mina-circle/circle-ci/project.rb', line 3

def name
  @name
end

#organizationObject (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_typeObject (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

#api_pathObject



15
16
17
# File 'lib/mina-circle/circle-ci/project.rb', line 15

def api_path
  api_path_parts.join('/')
end

#build_pathObject



19
20
21
22
23
# File 'lib/mina-circle/circle-ci/project.rb', line 19

def build_path
  parts = api_path_parts + ['tree', real_branch]
    
  parts.compact.join('/')
end