Class: PKCS11::CStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/pkcs11/extensions.rb,
ext/pk11.c

Overview

Base class of all PKCS#11 structs.

Instance Method Summary collapse

Instance Method Details

#inspectObject



38
39
40
# File 'lib/pkcs11/extensions.rb', line 38

def inspect
  "#<#{self.class} #{to_hash.map{|k,v| "#{k}=#{v.inspect}"}.join(", ") }>"
end

#to_hashHash

Returns with attribute names and current values.

Returns:

  • (Hash)

    with attribute names and current values



35
36
37
# File 'lib/pkcs11/extensions.rb', line 35

def to_hash
  members.inject({}){|h,v| h[v.intern] = send(v); h }
end

#valuesArray<String>

Returns attribute names.

Returns:

  • (Array<String>)

    attribute names



31
32
33
# File 'lib/pkcs11/extensions.rb', line 31

def values
  members.inject([]){|a,v| a << send(v) }
end