Class: Recipes::Api

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/potassium/recipes/api.rb

Instance Method Summary collapse

Instance Method Details

#askObject



2
3
4
5
# File 'lib/potassium/recipes/api.rb', line 2

def ask
  api_support = answer(:api) { Ask.confirm("Do you want to enable API support?") }
  set :api, api_support
end

#createObject



7
8
9
# File 'lib/potassium/recipes/api.rb', line 7

def create
  add_power_api if get(:api)
end

#installObject



11
12
13
14
# File 'lib/potassium/recipes/api.rb', line 11

def install
  ask
  create
end

#installed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/potassium/recipes/api.rb', line 16

def installed?
  gem_exists?(/power_api/)
end