Class: FFI::PCap::DataLink
- Inherits:
-
Object
- Object
- FFI::PCap::DataLink
- Defined in:
- lib/pcap/data_link.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
DataLink name.
-
#value ⇒ Object
readonly
PCap datalink numeric value.
Class Method Summary collapse
Instance Method Summary collapse
-
#description ⇒ Object
Returns the description of the datalink.
-
#initialize(value) ⇒ DataLink
constructor
Creates a new DataLink object with the specified value.
-
#inspect ⇒ Object
Inspects the datalink.
-
#to_i ⇒ Object
Returns the numeric value of the datalink.
-
#to_s ⇒ Object
Returns the String form of the datalink.
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
DataLink name
9 10 11 |
# File 'lib/pcap/data_link.rb', line 9 def name @name end |
#value ⇒ Object (readonly)
PCap datalink numeric value
6 7 8 |
# File 'lib/pcap/data_link.rb', line 6 def value @value end |
Class Method Details
.[](name) ⇒ Object
19 20 21 |
# File 'lib/pcap/data_link.rb', line 19 def self.[](name) PCap.pcap_datalink_name_to_val(name.to_s.downcase) end |
Instance Method Details
#description ⇒ Object
Returns the description of the datalink.
26 27 28 |
# File 'lib/pcap/data_link.rb', line 26 def description PCap.pcap_datalink_val_to_description(@value) end |
#inspect ⇒ Object
Inspects the datalink.
47 48 49 |
# File 'lib/pcap/data_link.rb', line 47 def inspect "#<#{self.class}: #{@name}>" end |
#to_i ⇒ Object
Returns the numeric value of the datalink.
33 34 35 |
# File 'lib/pcap/data_link.rb', line 33 def to_i @value end |
#to_s ⇒ Object
Returns the String form of the datalink.
40 41 42 |
# File 'lib/pcap/data_link.rb', line 40 def to_s @name end |