lib/ronin/mac_address.rb in ronin-1.0.0 vs lib/ronin/mac_address.rb in ronin-1.1.0.rc1

- old
+ new

@@ -16,16 +16,14 @@ # You should have received a copy of the GNU General Public License # along with Ronin. If not, see <http://www.gnu.org/licenses/>. # require 'ronin/address' -require 'ronin/model' +require 'ronin/ip_address' +require 'ronin/ip_address_mac_address' module Ronin - autoload :IPAddressMACAddress, 'ronin/ip_address_mac_address' - autoload :IPAddress, 'ronin/ip_address' - # # Represents MAC addresses that can be stored in the {Database}. # class MACAddress < Address @@ -47,10 +45,12 @@ # @return [IpAddress] # The IP Address that most recently used the MAC Address. # # @since 1.0.0 # + # @api public + # def recent_ip_address self.ip_address_mac_addresses.all( :order => [:created_at.desc] ).ip_addresses.first end @@ -60,9 +60,11 @@ # # @return [Integer] # The network representation of the MAC address. # # @since 1.0.0 + # + # @api public # def to_i self.address.split(':').inject(0) do |bits,char| bits = ((bits << 8) | char.hex) end