lib/pio/lldp/frame.rb in pio-0.3.0 vs lib/pio/lldp/frame.rb in pio-0.4.0
- old
+ new
@@ -1,7 +1,7 @@
-# -*- coding: utf-8 -*-
-require 'rubygems'
+# encoding: utf-8
+
require 'bindata'
require 'pio/lldp/chassis_id_tlv'
require 'pio/lldp/optional_tlv'
require 'pio/lldp/port_id_tlv'
@@ -14,17 +14,17 @@
class Frame < BinData::Record
extend Type::EthernetHeader
endian :big
- ethernet_header :ether_type => 0x88cc
+ ethernet_header ether_type: 0x88cc
chassis_id_tlv :chassis_id
port_id_tlv :port_id
- ttl_tlv :ttl, :initial_value => 120
+ ttl_tlv :ttl, initial_value: 120
array(:optional_tlv,
- :type => :optional_tlv,
- :read_until => lambda { element.end_of_lldpdu? })
+ type: :optional_tlv,
+ read_until: -> { element.end_of_lldpdu? })
def dpid
chassis_id.to_i
end
@@ -66,11 +66,5 @@
tlv[name] if tlv
end
end
end
end
-
-### Local variables:
-### mode: Ruby
-### coding: utf-8-unix
-### indent-tabs-mode: nil
-### End: