class Rex::Proto::Kerberos::Model::Element
This class provides a representation of a principal, an asset (e.g., a workstation user or a network server) on a network.
Public Class Methods
attr_accessor(*vars)
click to toggle source
Calls superclass method
# File lib/rex/proto/kerberos/model/element.rb, line 13 def self.attr_accessor(*vars) @attributes ||= [] @attributes.concat vars super(*vars) end
attributes()
click to toggle source
Retrieves the element class fields
@return [Array]
# File lib/rex/proto/kerberos/model/element.rb, line 22 def self.attributes @attributes end
decode(input)
click to toggle source
# File lib/rex/proto/kerberos/model/element.rb, line 26 def self.decode(input) elem = self.new elem.decode(input) end
new(options = {})
click to toggle source
# File lib/rex/proto/kerberos/model/element.rb, line 31 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
Public Instance Methods
attributes()
click to toggle source
Retrieves the element instance fields
@return [Array]
# File lib/rex/proto/kerberos/model/element.rb, line 43 def attributes self.class.attributes end
decode(input)
click to toggle source
Decodes the Rex::Proto::Kerberos::Model::Element
from the input. This method has been designed to be overridden by subclasses.
@raise [NoMethodError]
# File lib/rex/proto/kerberos/model/element.rb, line 51 def decode(input) raise ::NoMethodError, 'Method designed to be overridden' end
encode()
click to toggle source
Encodes the Rex::Proto::Kerberos::Model::Element
into an ASN.1 String. This method has been designed to be overridden by subclasses.
@raise [NoMethodError]
# File lib/rex/proto/kerberos/model/element.rb, line 59 def encode raise ::NoMethodError, 'Method designed to be overridden' end