Class: SASL::Preferences

Inherits:
Object
  • Object
show all
Defined in:
lib/sasl/base.rb

Overview

You must derive from class Preferences and overwrite methods you want to implement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Preferences

key in config hash authzid: Authorization identitiy (‘username@domain’ in XMPP) realm: Realm (‘domain’ in XMPP) digest-uri: : serv-type/serv-name | serv-type/host/serv-name (‘xmpp/domain’ in XMPP) username has_password? allow_plaintext? password want_anonymous?



20
21
22
# File 'lib/sasl/base.rb', line 20

def initialize (config)
  @config = {:has_password? => false, :allow_plaintext? => false, :want_anonymous? => false}.merge(config.dup)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



23
24
25
# File 'lib/sasl/base.rb', line 23

def method_missing(sym, *args, &block)
  @config.send "[]", sym, &block
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/sasl/base.rb', line 9

def config
  @config
end