Class: Couchup::Commands::Get
- Inherits:
-
Object
- Object
- Couchup::Commands::Get
- Includes:
- Couchup::CommandExtensions
- Defined in:
- lib/couchup/commands/get.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Couchup::CommandExtensions
Class Method Details
.describe ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/couchup/commands/get.rb', line 12 def self.describe { :description => "Retrives documents from the current database", :usage => "get [:doc], [<id>]", :examples => ["get :doc, '2a663b5936f98fe225d64fcaa89e3281'", "get"] } end |
Instance Method Details
#run(id = nil) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/couchup/commands/get.rb', line 5 def run(id = nil) needs_db! match = id.nil? ? Couchup.all.collect{|c| c["doc"]} : Couchup.get(id) ap match match end |