Module: RhnSatellite::Common::Collection

Defined in:
lib/rhn_satellite/common/collection.rb

Instance Method Summary collapse

Instance Method Details

#all(&blk) ⇒ Object



4
5
6
7
8
# File 'lib/rhn_satellite/common/collection.rb', line 4

def all(&blk)
  result = base.default_call(@collection_cmd).to_a
  result.each {|record| yield(record) } if block_given?
  result
end

#get(name) ⇒ Object



10
11
12
# File 'lib/rhn_satellite/common/collection.rb', line 10

def get(name)
  all.find{|item| item["name"] =~ /#{name}/ }
end