Class: DhcpsApi::DWORD_DWORD

Inherits:
DHCPS_Struct show all
Defined in:
lib/dhcpsapi/data_structures.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DHCPS_Struct

ruby_struct_attr

Methods included from RubyStructAttrHelpers

#dhcp_client_uid_to_mac, #ip_to_uint32, #mac_address_to_array_of_uint8, #to_string, #to_wchar_string, #uint32_to_ip, #wchar_string_length

Class Method Details

.from_int(an_int) ⇒ Object



111
112
113
114
115
116
# File 'lib/dhcpsapi/data_structures.rb', line 111

def self.from_int(an_int)
  to_return = new
  to_return[:dword1] = ((an_int >> 32) & 0xffffffff)
  to_return[:dword2] = (an_int & 0xffffffff)
  to_return
end

Instance Method Details

#as_ruby_structObject



118
119
120
# File 'lib/dhcpsapi/data_structures.rb', line 118

def as_ruby_struct
  (self[:dword1] << 32) | self[:dword2]
end