Module: Spore::Client::Cells

Included in:
Spore::Client
Defined in:
lib/spore/client/cells.rb

Instance Method Summary collapse

Instance Method Details

#create_cell(app_id, environment, key, value, cell_id = nil) ⇒ Object



4
5
6
7
8
9
# File 'lib/spore/client/cells.rb', line 4

def create_cell(app_id, environment, key, value, cell_id = nil)
  cell_id = SecureRandom.uuid if cell_id.nil?
  path = "/apps/#{app_id}/envs/#{environment}/cells"
  response = post path, { id: cell_id, key: key, value: value }, { async: true }
  response.body["cell"]
end

#get_cell(app_id, environment, cell_id) ⇒ Object



11
12
13
14
15
# File 'lib/spore/client/cells.rb', line 11

def get_cell(app_id, environment, cell_id)
  path = "/apps/#{app_id}/envs/#{environment}/cells/#{cell_id}"
  response = get path
  response.body["cell"]
end