class Fission::Lease

def self.find_by_mac_address(mac_address)

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

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

Examples

mac_address - MAC address (String) to search for.

Public: Get lease information for a specific MAC address.
def self.find_by_mac_address(mac_address)
  all_response = all
  if all_response.successful?
    response = Response.new :code => 0
    leases = all_response.data.find_all { |l| l.mac_address == mac_address }
    response.data = leases.sort_by { |l| l.end }.last
  else
    response = all_response
  end
  response
end