class CfScript::Command::Spaces::SpaceCommand

Public Class Methods

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

Public Instance Methods

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

    if space = build_space(space_name, output)
      block_given? ? yield(space) : space
    else
      error 'object is nil'
    end
  end
end

Private Instance Methods

build_space(space_name, output) click to toggle source
# File lib/cf_script/command/cf/spaces/space.rb, line 21
def build_space(space_name, output)
  attrs = output.attributes

  unless attrs.empty?
    CfScript::Space.new(
      space_name,
      attrs[:org].value,
      attrs[:apps].to_a,
      attrs[:domains].to_a,
      attrs[:services].to_a,
      attrs[:security_groups].to_a
    )
  end
end