Class: BitBucket::Repos::Download

Inherits:
API
  • Object
show all
Defined in:
lib/bitbucket_rest_api/repos/download.rb

Constant Summary collapse

REQUIRED_KEY_PARAM_NAMES =
%w[commit_hash].freeze

Constants included from Validations

Validations::VALID_API_KEYS

Constants included from Validations::Token

Validations::Token::TOKEN_REQUIRED, Validations::Token::TOKEN_REQUIRED_REGEXP

Constants included from BitBucket::Request

BitBucket::Request::METHODS, BitBucket::Request::METHODS_WITH_BODIES

Constants included from Connection

Connection::ALLOWED_OPTIONS

Instance Method Summary collapse

Methods inherited from API

#_merge_mime_type, #_merge_user_into_params!, #_merge_user_repo_into_params!, #_update_user_repo_params, #api_methods_in, inherited, #initialize, #method_missing, #process_basic_auth, #set_api_client, #setup, #update_and_validate_user_repo_params

Methods included from Normalizer

#normalize!

Methods included from ParameterFilter

#filter!

Methods included from AutoloadHelper

#autoload_all, #lookup_constant, #register_constant

Methods included from Validations::Required

#assert_required_keys, #assert_required_values_present, #parse_values

Methods included from Validations::Token

#validates_token_for

Methods included from Validations::Format

#assert_valid_values

Methods included from Validations::Presence

#_validate_presence_of, #_validate_user_repo_params

Methods included from BitBucket::Request

#delete_request, #get_request, #patch_request, #post_request, #put_request, #request

Methods included from Connection

caching?, clear_cache, connection, default_middleware, default_options, stack

Methods included from Authorization

#authenticated?, #authentication, #basic_authed?

Constructor Details

This class inherits a constructor from BitBucket::API

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BitBucket::API

Instance Method Details

#get(user_name, repo_name, params = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/bitbucket_rest_api/repos/download.rb', line 5

def get(user_name, repo_name, params = {})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  #       normalize! params
  #       assert_required_keys(REQUIRED_KEY_PARAM_NAMES, params)

  # https://bitbucket.org/jhanley85/eternum_canvas_demo/get/fd931f96f12d.zip
  "https://bitbucket.org/#{user}/#{repo.downcase}/get/#{params[:commit_hash]}.tar.gz"
end