Sha256: 2bae64f3c10a5345cebea4fb6b73c951d5eadf2ba1c9c8b183d9b075814bfb29

Contents?: true

Size: 539 Bytes

Versions: 5

Compression:

Stored size: 539 Bytes

Contents

class LoadbalancersController < MVCLI::Controller
  requires :loadbalancers
  requires :command

  def index
    loadbalancers.all
  end

  def show
    balancer
  end

  def create
    template = Loadbalancers::CreateForm
    argv = MVCLI::Argv.new command.argv
    form = template.new argv.options
    form.validate!
    loadbalancers.create form.value
  end

  def destroy
    balancer.tap do |b|
      b.destroy
    end
  end

  private

  def balancer
    index.find {|s| s.name == params[:id]} or fail Fog::Erors::NotFound
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rumm-0.0.7 app/controllers/loadbalancers_controller.rb
rumm-0.0.6 app/controllers/loadbalancers_controller.rb
rumm-0.0.5 app/controllers/loadbalancers_controller.rb
rumm-0.0.4 app/controllers/loadbalancers_controller.rb
rumm-0.0.3 app/controllers/loadbalancers_controller.rb