Class: HiveQueen

Inherits:
Object
  • Object
show all
Defined in:
lib/hivequeen_client/hivequeen.rb

Overview

Special cases:

  • environment not found

  • environment not ready: fail

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.endpointObject

Returns the value of attribute endpoint.



11
12
13
# File 'lib/hivequeen_client/hivequeen.rb', line 11

def endpoint
  @endpoint
end

.loggerObject

Returns the value of attribute logger.



11
12
13
# File 'lib/hivequeen_client/hivequeen.rb', line 11

def logger
  @logger
end

Class Method Details

.environment_namesObject



21
22
23
# File 'lib/hivequeen_client/hivequeen.rb', line 21

def environment_names
  environments.map{|e| e['name'].to_sym }
end

.environmentsObject



17
18
19
# File 'lib/hivequeen_client/hivequeen.rb', line 17

def environments
  project_data['environments']
end

.project_dataObject



13
14
15
# File 'lib/hivequeen_client/hivequeen.rb', line 13

def project_data
  @project_data ||= fetch('/projects/kickstarter')
end

.repositoryObject



25
26
27
# File 'lib/hivequeen_client/hivequeen.rb', line 25

def repository
  project_data['repo']
end

.roles(env_id) ⇒ Object



29
30
31
32
33
# File 'lib/hivequeen_client/hivequeen.rb', line 29

def roles(env_id)
  env_id = env_id.to_sym
  @roles ||= {}
  @roles[env_id] ||= fetch("/environments/#{env_id}")
end