Class: Pio::Arp::Request::Options
- Defined in:
- lib/pio/arp/request.rb
Overview
User options for creating an Arp Request.
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Options
constructor
A new instance of Options.
- #to_hash ⇒ Object
Methods inherited from Options
Constructor Details
#initialize(options) ⇒ Options
Returns a new instance of Options.
23 24 25 26 27 28 29 30 |
# File 'lib/pio/arp/request.rb', line 23 def initialize() validate @source_mac = Mac.new([:source_mac]).freeze @sender_protocol_address = IPv4Address.new([:sender_protocol_address]).freeze @target_protocol_address = IPv4Address.new([:target_protocol_address]).freeze end |
Instance Method Details
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pio/arp/request.rb', line 32 def to_hash { operation: OPERATION, source_mac: @source_mac, destination_mac: BROADCAST_MAC, sender_hardware_address: @source_mac, target_hardware_address: ALL_ZERO_MAC, sender_protocol_address: @sender_protocol_address, target_protocol_address: @target_protocol_address }.freeze end |