Class Fission::Lease
In: lib/fission/lease.rb
Parent: Object

Methods

Attributes

end  [RW]  Public: Get/set the end DateTime for the lease.
ip_address  [RW]  Public: Get/set the IP address for the lease.
mac_address  [RW]  Public: Get/set the MAC address for the lease.
start  [RW]  Public: Get/set the start DateTime for the lease.

Public Class methods

Public: Provides all of the known leases.

Examples:

  Fission::Lease.all
  # => [#<Fission::Lease:0x000001008b6d88...>,
        #<Fission::Lease:0x000001008522c0...>]

Returns a Response with the result. If successful, the Response‘s data attribute will be an Array of Lease objects. If no leases are found, then the Response‘s data attribute will be an empty Array. If there is an error, an unsuccessful Response will be returned.

Public: Get lease information for a specific MAC address.

mac_address - MAC address (String) to search for.

Examples

  Fission::Lease.find_by_mac '00:11:AA:bb:cc:22'
  # => #<Fission::Lease:0x000001008522c0...>

Returns a Response with the result. If successful, the Response‘s data attribute will be a Lease object if the MAC address was found. The Response‘s data attribute will be nil if the MAC address was not found. If there is an error, an unsuccessful Response will be returned.

Public: Initialize a Lease object.

args - Hash of arguments:

       :ip_address  - String which denotes the IP address of the lease.
       :mac_address - String which denotes the MAC address of the lease.
       :start       - DateTime which denotes the start of the lease.
       :end         - DateTime which denotes the end of the lease.

Examples

Returns a new Lease instance.

Public Instance methods

Public: Determine if the lease has expired or not.

Examples:

  @lease.expired?
  # => true

Returns a Boolean. The Boolean is determined by comparing the end attribute to the current date/time.

[Validate]