Module: PacketGen::Headerable::ClassMethods
- Defined in:
- lib/packetgen/headerable.rb
Overview
This modules handles class methods for headerable classes.
Instance Method Summary collapse
-
#protocol_name ⇒ String
Give protocol name for this class.
Instance Method Details
#protocol_name ⇒ String
Give protocol name for this class
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/packetgen/headerable.rb', line 19 def protocol_name return @protocol_name if defined? @protocol_name classname = to_s @protocol_name = if classname.start_with?('PacketGen::Header') classname.sub(/.*Header::/, '') else classname.sub(/.*::/, '') end end |