Module: Couchup::ShortHands

Defined in:
lib/couchup/short_hands.rb

Instance Method Summary collapse

Instance Method Details

#create_db(*params) ⇒ Object



15
16
17
# File 'lib/couchup/short_hands.rb', line 15

def create_db(*params)
  create :database, *params
end

#create_view(*params) ⇒ Object



12
13
14
# File 'lib/couchup/short_hands.rb', line 12

def create_view(*params)
  create :view, *params
end

#drop_db(*params) ⇒ Object



35
36
37
# File 'lib/couchup/short_hands.rb', line 35

def drop_db(*params)
  drop :database, *params
end

#drop_view(*params) ⇒ Object



31
32
33
# File 'lib/couchup/short_hands.rb', line 31

def drop_view(*params)
  drop :view, *params
end

#included(base) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/couchup/short_hands.rb', line 3

def included(base)
  %w{create drop show}.each do |action|
    ['view', 'db'].each { |on| base.send "#{action}_#{on}"}
  end
  alias :create_database :create_db
  alias :drop_database :drop_db 
  alias :show_database :show_db 
end

#show_db(*params) ⇒ Object



23
24
25
# File 'lib/couchup/short_hands.rb', line 23

def show_db(*params)
  show :databases, *params
end

#show_view(*params) ⇒ Object



19
20
21
# File 'lib/couchup/short_hands.rb', line 19

def show_view(*params)
  show :view, *params
end