Module: CF::Populators::PopulatorMethods

Included in:
Organization, Space
Defined in:
lib/cf/cli/populators/populator_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/cf/cli/populators/populator_methods.rb', line 4

def self.included(klass)
  klass.class_eval do
    define_method(:type) do
      klass.name.split("::").last.downcase.to_sym
    end
  end
end

Instance Method Details

#populate_and_save!Object



12
13
14
15
16
17
18
19
# File 'lib/cf/cli/populators/populator_methods.rb', line 12

def populate_and_save!
  obj = get_object
  info[type] = obj.guid unless obj.nil?
  save_target_info(info)
  invalidate_client

  obj
end