Class: CircleCi::ApiProjectResource
- Inherits:
-
ApiResource
- Object
- ApiResource
- CircleCi::ApiProjectResource
- Defined in:
- lib/circleci/api_project_resource.rb
Overview
Class for interacting with project API resources
Constant Summary collapse
- VALID_VCS_TYPES =
%w[github bitbucket].freeze
- DEFAULT_VCS_TYPE =
VALID_VCS_TYPES.first.freeze
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#vcs_type ⇒ Object
readonly
Returns the value of attribute vcs_type.
Attributes inherited from ApiResource
Instance Method Summary collapse
- #base_path ⇒ Object
-
#initialize(username = nil, project = nil, vcs_type = nil, build = nil, conf = nil) ⇒ CircleCi::Project
constructor
Initialize a new Project API interaction.
Methods inherited from ApiResource
default_config, #default_config
Constructor Details
#initialize(username = nil, project = nil, vcs_type = nil, build = nil, conf = nil) ⇒ CircleCi::Project
Initialize a new Project API interaction
22 23 24 25 26 |
# File 'lib/circleci/api_project_resource.rb', line 22 def initialize(username = nil, project = nil, vcs_type = nil, build = nil, conf = nil) super(username, project, conf) @vcs_type = VALID_VCS_TYPES.include?(vcs_type) ? vcs_type : DEFAULT_VCS_TYPE @build = build end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
10 11 12 |
# File 'lib/circleci/api_project_resource.rb', line 10 def build @build end |
#vcs_type ⇒ Object (readonly)
Returns the value of attribute vcs_type.
10 11 12 |
# File 'lib/circleci/api_project_resource.rb', line 10 def vcs_type @vcs_type end |
Instance Method Details
#base_path ⇒ Object
28 29 30 |
# File 'lib/circleci/api_project_resource.rb', line 28 def base_path "/project/#{vcs_type}/#{username}/#{project}" end |