Class: VLANLease
- Inherits:
-
Object
- Object
- VLANLease
- Defined in:
- models/VLANManager.rb
Overview
Table of VLAN IDs leases Model Class
Class Method Summary collapse
-
.all_with_meta(id = nil) ⇒ Array<Hash>
Returns all VLANLease or all VLANLease for given VLAN pool if id is given.
Instance Method Summary collapse
-
#hash_with_meta ⇒ Hash
Returns VLANLease as Hash with additional data If VLAN ID is provisioned to VNet, :vn_name key will be added.
-
#to_json(*args) ⇒ Object
Needed for serialization.
Class Method Details
Instance Method Details
#hash_with_meta ⇒ Hash
Returns VLANLease as Hash with additional data If VLAN ID is provisioned to VNet, :vn_name key will be added
66 67 68 69 70 71 72 |
# File 'models/VLANManager.rb', line 66 def if vn then to_hash.merge(vn_name: $db[:network_pool].where(oid: vn).select(:name).first[:name]) else to_hash end end |
#to_json(*args) ⇒ Object
Needed for serialization
50 51 52 |
# File 'models/VLANManager.rb', line 50 def to_json *args @values.without(:key).to_json(*args) end |