Class: Rex::Proto::Kerberos::CredentialCache::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/proto/kerberos/credential_cache/element.rb

Direct Known Subclasses

Cache, Credential, KeyBlock, Principal, Time

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Element

Returns a new instance of Element.


22
23
24
25
26
27
28
29
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 22

def initialize(options = {})
  self.class.attributes.each do |attr|
    if options.has_key?(attr)
      m = (attr.to_s + '=').to_sym
      self.send(m, options[attr])
    end
  end
end

Class Method Details

.attr_accessor(*vars) ⇒ Object


9
10
11
12
13
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 9

def self.attr_accessor(*vars)
  @attributes ||= []
  @attributes.concat vars
  super(*vars)
end

.attributesArray

Retrieves the element class fields

Returns:

  • (Array)

18
19
20
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 18

def self.attributes
  @attributes
end

Instance Method Details

#attributesArray

Retrieves the element instance fields

Returns:

  • (Array)

34
35
36
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 34

def attributes
  self.class.attributes
end

#encodeObject

Encodes the Rex::Proto::Kerberos::CredentialCache::Element into an String. This method has been designed to be overridden by subclasses.

Raises:

  • (NoMethodError)

42
43
44
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 42

def encode
  raise ::NoMethodError, 'Method designed to be overridden'
end