Class: Pio::Type::MacAddress
- Inherits:
-
BinData::Primitive
- Object
- BinData::Primitive
- Pio::Type::MacAddress
- Defined in:
- lib/pio/type/mac_address.rb
Overview
MAC address
Instance Method Summary collapse
Instance Method Details
#get ⇒ Object
14 15 16 17 18 |
# File 'lib/pio/type/mac_address.rb', line 14 def get Mac.new(octets.reduce('') do |str, each| str + format('%02x', each) end.hex) end |
#set(value) ⇒ Object
10 11 12 |
# File 'lib/pio/type/mac_address.rb', line 10 def set(value) self.octets = Mac.new(value).to_a end |