123456789_123456789_123456789_123456789_123456789_

Class: Win32::SSPI::SSPIResult

Relationships & Source Files
Inherits: Object
Defined in: ext/win32/lib/win32/sspi.rb

Overview

Takes a return result from an ::Win32::SSPI function and interprets the value.

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(value) ⇒ SSPIResult

[ GitHub ]

  
# File 'ext/win32/lib/win32/sspi.rb', line 181

def initialize(value)
	# convert to unsigned long
	value = [value].pack("L").unpack("L").first
	raise "#{value.to_s(16)} is not a recognized result" unless @@map.has_key? value
	@value = value
end

Instance Attribute Details

#ok?Boolean (readonly)

[ GitHub ]

  
# File 'ext/win32/lib/win32/sspi.rb', line 192

def ok?
	@value == SEC_I_CONTINUE_NEEDED || @value == SEC_E_OK
end

#value (readonly)

[ GitHub ]

  
# File 'ext/win32/lib/win32/sspi.rb', line 179

attr_reader :value

Instance Method Details

#==(other)

[ GitHub ]

  
# File 'ext/win32/lib/win32/sspi.rb', line 196

def ==(other)
	if other.is_a?(SSPIResult)
		@value == other.value
	elsif other.is_a?(Fixnum)
		@value == @@map[other]
	else
		false
	end
end

#to_s

[ GitHub ]

  
# File 'ext/win32/lib/win32/sspi.rb', line 188

def to_s
	@@map[@value].to_s
end