25 lines
		
	
	
		
			498 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			498 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| module Connectors
 | |
|   class Stack < Base
 | |
|     include Helpers::InsertCommand,
 | |
|       Helpers::ShowCommand,
 | |
|       Helpers::ListCommand,
 | |
|       Helpers::DeleteCommand,
 | |
|       Helpers::UpdateCommand
 | |
| 
 | |
|     def initialize(db)
 | |
|       self.collection = db.collection('stacks')
 | |
|     end
 | |
| 
 | |
|     def stacks(options={})
 | |
|       list(options)
 | |
|     end
 | |
| 
 | |
|     private
 | |
| 
 | |
|     def model_from_bson(bson)
 | |
|       provider = bson['provider']
 | |
|       Devops::Model::StackFactory.get_class(provider).build_from_bson(bson)
 | |
|     end
 | |
|   end
 | |
| end
 | 
