Class: Git::Semaphore::API::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/git/semaphore/api_cache.rb

Class Method Summary collapse

Class Method Details

.branches(project_hash_id, auth_token) ⇒ Object



12
13
14
15
16
# File 'lib/git/semaphore/api_cache.rb', line 12

def self.branches project_hash_id, auth_token
  @branches ||= Git::Semaphore.from_json_cache(branches_cache(project_hash_id)) do
    API.branches project_hash_id, auth_token
  end
end

.history(project_hash_id, branch_id, auth_token) ⇒ Object



24
25
26
27
28
# File 'lib/git/semaphore/api_cache.rb', line 24

def self.history project_hash_id, branch_id, auth_token
  @history ||= Git::Semaphore.from_json_cache(history_cache(project_hash_id, branch_id)) do
    API::Enrich.history project_hash_id, branch_id, auth_token
  end
end

.information(project_hash_id, branch_id, build_number, auth_token) ⇒ Object



30
31
32
33
34
# File 'lib/git/semaphore/api_cache.rb', line 30

def self.information project_hash_id, branch_id, build_number, auth_token
  @information ||= Git::Semaphore.from_json_cache(information_cache(project_hash_id, branch_id, build_number)) do
    API.information project_hash_id, branch_id, build_number, auth_token
  end
end

.log(project_hash_id, branch_id, build_number, auth_token) ⇒ Object



36
37
38
39
40
# File 'lib/git/semaphore/api_cache.rb', line 36

def self.log project_hash_id, branch_id, build_number, auth_token
  @log ||= Git::Semaphore.from_json_cache(log_cache(project_hash_id, branch_id, build_number)) do
    API.log project_hash_id, branch_id, build_number, auth_token
  end
end

.projects(auth_token) ⇒ Object



6
7
8
9
10
# File 'lib/git/semaphore/api_cache.rb', line 6

def self.projects auth_token
  @projects ||= Git::Semaphore.from_json_cache(projects_cache) do
    API::Enrich.projects auth_token
  end
end

.status(project_hash_id, branch_id, auth_token) ⇒ Object



18
19
20
21
22
# File 'lib/git/semaphore/api_cache.rb', line 18

def self.status project_hash_id, branch_id, auth_token
  @status ||= Git::Semaphore.from_json_cache(status_cache(project_hash_id, branch_id)) do
    API.status project_hash_id, branch_id, auth_token
  end
end