metasploit-framework/lib/rex/proto/kerberos/credential_cache/element.rb

47 lines
1.0 KiB
Ruby
Raw Normal View History

# -*- coding: binary -*-
2014-12-18 06:30:47 +00:00
module Rex
module Proto
module Kerberos
module CredentialCache
class Element
def self.attr_accessor(*vars)
@attributes ||= []
@attributes.concat vars
super(*vars)
end
# Retrieves the element class fields
#
# @return [Array]
2014-12-18 06:30:47 +00:00
def self.attributes
@attributes
end
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
# Retrieves the element instance fields
#
# @return [Array]
2014-12-18 06:30:47 +00:00
def attributes
self.class.attributes
end
# Encodes the Rex::Proto::Kerberos::CredentialCache::Element into an String
#
# @return [String]
2014-12-18 06:30:47 +00:00
def encode
''
end
end
end
end
end
end