Class: LayerVault::Organization

Inherits:
Model
  • Object
show all
Defined in:
lib/layervault/organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

build_associations, #set_context

Class Method Details

.for(organization) ⇒ Object



4
5
6
7
8
# File 'lib/layervault/organization.rb', line 4

def for( organization )
  resp = MultiJson.decode(LayerVault.client.organization( organization ))
  instance = build_associations(resp, :projects)
  instance.set_context(organization: organization)
end

Instance Method Details

#create_project(project_name) ⇒ Object



11
12
13
# File 'lib/layervault/organization.rb', line 11

def create_project(project_name)
  LayerVault.client.create_project( context.organization, project_name )
end

#delete_project(project_name) ⇒ Object



15
16
17
# File 'lib/layervault/organization.rb', line 15

def delete_project(project_name)
  LayerVault.client.create_project( context.organization, project_name )
end