Class: Arp

Inherits:
ShellCommands show all
Defined in:
app/models/dhcp.rb,
app/models/arp.rb,
app/models/router.rb

Overview

DHCP

Defined Under Namespace

Modules: Constants

Constant Summary

Constants included from ShellCommands::Examples

ShellCommands::Examples::COMMAND_STRING, ShellCommands::Examples::Cd_command_array, ShellCommands::Examples::Cd_command_hash, ShellCommands::Examples::EXAMPLE, ShellCommands::Examples::Example_output, ShellCommands::Examples::Guaranteed_existing_basename, ShellCommands::Examples::Guaranteed_existing_directory, ShellCommands::Examples::Hello_world, ShellCommands::Examples::Redirect_command, ShellCommands::Examples::Redirect_command_string, ShellCommands::Examples::Relative_command

Instance Attribute Summary

Attributes inherited from ShellCommands

#command_string, #errors, #output, #process_status

Instance Method Summary collapse

Methods inherited from ShellCommands

#close, #execute, #fork, #inspect, #parse_argument_array, #puts, #server, #start, #success?, #trace, #wait

Methods included from ShellCommands::ClassMethods

#assemble_array_command, #assemble_command_string, #assemble_hash_command

Methods included from ShellCommands::Assertions

#assert_post_conditions, #assert_pre_conditions

Constructor Details

#initializeArp

Constants


8
9
10
# File 'app/models/arp.rb', line 8

def initialize
	super('cat /proc/net/arp')
end

Instance Method Details

#MAC(ip) ⇒ Object

initialize


11
12
13
# File 'app/models/arp.rb', line 11

def MAC(ip)
	parse(/#{ip} ([0-9A-F]+\:[0-9A-F]+\:[0-9A-F]+\:[0-9A-F]+)/, @errors)
end