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

32 lines
549 B
Ruby

require "db/mongo/models/image"
module Connectors
class Image < Base
include Helpers::InsertCommand,
Helpers::ShowCommand,
Helpers::ListCommand,
Helpers::DeleteCommand,
Helpers::UpdateCommand
def initialize(db)
super(db)
end
def collection_name
'images'
end
def images(provider=nil)
query = (provider.nil? ? {} : {'provider' => provider})
list(query)
end
private
def model_from_bson(bson)
Devops::Model::Image.build_from_bson(bson)
end
end
end