Class: Pio::Arp::Reply::Options
Overview
User options for creating an Arp Reply.
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.
21 22 23 24 25 26 27 28 29 |
# File 'lib/pio/arp/reply.rb', line 21 def initialize() validate @source_mac = Mac.new([:source_mac]).freeze @destination_mac = Mac.new([:destination_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
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pio/arp/reply.rb', line 31 def to_hash { operation: OPERATION, source_mac: @source_mac, destination_mac: @destination_mac, sender_hardware_address: @source_mac, target_hardware_address: @destination_mac, sender_protocol_address: @sender_protocol_address, target_protocol_address: @target_protocol_address }.freeze end |