Class: OsCtld::DB::Pools

Inherits:
List
  • Object
show all
Defined in:
lib/osctld/db/pools.rb

Instance Attribute Summary

Attributes inherited from List

#objects

Instance Method Summary collapse

Methods inherited from List

#add, #contains?, #count, #find, #get, instance, #remove, #sync

Instance Method Details

#get_or_default(name) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/osctld/db/pools.rb', line 13

def get_or_default(name)
  sync do
    if name
      find(name)

    else
      objects.first
    end
  end
end