fluke/devops-service/db/mongo/connectors/stack.rb

25 lines
530 B
Ruby
Raw Normal View History

2015-02-12 13:01:05 +03:00
module Connectors
class Stack < Base
include Helpers::InsertCommand,
Helpers::ShowCommand,
Helpers::ListCommand,
Helpers::DeleteCommand
def initialize(db)
self.collection = db.collection('stacks')
end
def stacks(provider=nil)
query = (provider.nil? ? {} : {'provider' => provider})
list(query)
end
private
def model_from_bson(bson)
provider = bson['provider']
2015-03-06 12:20:30 +03:00
Devops::Model::StackFactory.get_class(provider).build_from_bson(bson)
2015-02-12 13:01:05 +03:00
end
end
end