Class: Rex::Proto::Kerberos::CredentialCache::Element
- Inherits:
-
Object
- Object
- Rex::Proto::Kerberos::CredentialCache::Element
- Defined in:
- lib/rex/proto/kerberos/credential_cache/element.rb
Direct Known Subclasses
Class Method Summary collapse
- .attr_accessor(*vars) ⇒ Object
-
.attributes ⇒ Array
Retrieves the element class fields.
Instance Method Summary collapse
-
#attributes ⇒ Array
Retrieves the element instance fields.
-
#encode ⇒ Object
Encodes the Rex::Proto::Kerberos::CredentialCache::Element into an String.
-
#initialize(options = {}) ⇒ Element
constructor
A new instance of Element.
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( = {}) self.class.attributes.each do |attr| if .has_key?(attr) m = (attr.to_s + '=').to_sym self.send(m, [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 |
.attributes ⇒ Array
Retrieves the element class fields
18 19 20 |
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 18 def self.attributes @attributes end |
Instance Method Details
#attributes ⇒ Array
Retrieves the element instance fields
34 35 36 |
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 34 def attributes self.class.attributes end |
#encode ⇒ Object
Encodes the Rex::Proto::Kerberos::CredentialCache::Element into an String. This method has been designed to be overridden by subclasses.
42 43 44 |
# File 'lib/rex/proto/kerberos/credential_cache/element.rb', line 42 def encode raise ::NoMethodError, 'Method designed to be overridden' end |