Class: Dcmgr::Tags::NetworkPool
- Inherits:
-
Models::Tag
- Object
- Sequel::Model
- Models::BaseNew
- Models::AccountResource
- Models::Tag
- Dcmgr::Tags::NetworkPool
- Defined in:
- lib/dcmgr/tags.rb
Constant Summary
Constants inherited from Models::BaseNew
Models::BaseNew::LOCK_TABLES_KEY
Instance Method Summary collapse
Methods inherited from Models::Tag
#before_destroy, find_tag_class, #label, #labeled?, #lable_ifnot, lock!, #to_api_document, #unlabel
Methods inherited from Models::AccountResource
Methods inherited from Models::BaseNew
Proxy, dataset, default_row_lock_mode=, install_data, install_data_hooks, lock!, #to_hash, unlock!, #with_timestamps?
Instance Method Details
#accept_mapping?(to) ⇒ Boolean
20 21 22 |
# File 'lib/dcmgr/tags.rb', line 20 def accept_mapping?(to) to.is_a?(Dcmgr::Models::Network) end |
#pick ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/dcmgr/tags.rb', line 24 def pick() lst = mapped_uuids.map { |t| Dcmgr::Models::Network[t.uuid] }.sort_by{ |n| n.available_ip_nums }.reverse.first end |