require "jdc/cli" require "jdc/cli/populators/organization" module JDC module Space class Base < CLI attr_reader :org def precondition check_key check_target check_organization_and_space #check_logged_in end def run(name) @org = JDC::Populators::Organization.new(input).populate_and_save! super(name) end def self.space_by_name proc { |name, org, *_| org.space_by_name(name) || fail("Unknown space '#{name}'.") } end end end end