Sha256: 7bd78671943469ddf98ebc980a11fb8f781d87b8268b29cac898cb7ea7f1b5fa

Contents?: true

Size: 495 Bytes

Versions: 6

Compression:

Stored size: 495 Bytes

Contents

module ServiceObjects
  class SendArpPackets
      attr_reader :config, :packets

      def initialize(config, packets)
        @config  = config
        @packets = [packets].flatten
      end

      def call
        @i = 0

        loop do
          packets.each do |packet|
            @i += 1
            packet.to_w(config.interface)

            print "\r The ARP packet has been sent successfully #{@i} times"

            sleep config.delay
          end
        end
      end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ownlan-0.4.6 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.4.4 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.4.3 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.4.2 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.4.1 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.4.0 lib/ownlan/service_objects/send_arp_packets.rb