class CfScript::Command::Spaces::SpacesCommand

Constants

SPACES_TABLE

Public Class Methods

new() click to toggle source
Calls superclass method CfScript::Command::Base::new
# File lib/cf_script/command/cf/spaces/spaces.rb, line 5
def initialize
  super(:spaces, :spaces)
end

Public Instance Methods

run(*args) { |spaces| ... } click to toggle source
# File lib/cf_script/command/cf/spaces/spaces.rb, line 9
def run(*args, &block)
  run_cf self, *args do |output|
    return unless good_run?(output)

    if rows = output.table(SPACES_TABLE)
      spaces = rows.map { |row| row[:name].value }

      block_given? ? yield(spaces) : spaces
    else
      error "Spaces table was not found"
    end
  end
end