Class HTTPAuth::Digest::AbstractHeader
In: lib/httpauth/digest.rb
Parent: Object

Superclass for all the header container classes

Methods

Attributes

h  [R]  holds directives and values for digest calculation

Public Instance methods

Redirects attribute messages to the internal directives

Example:

  class Credentials < AbstractHeader
    def initialize
      @h = { :username => 'Ben' }
    end
  end

  c = Credentials.new
  c.username #=> 'Ben'
  c.username = 'Mary'
  c.username #=> 'Mary'

[Source]

     # File lib/httpauth/digest.rb, line 261
261:       def method_missing(m, *a)
262:         if ((m.to_s =~ /^(.*)=$/) == 0) and @h.keys.include?($1.intern)
263:           @h[$1.intern] = a[0]
264:         elsif @h.keys.include? m
265:           @h[m]
266:         else
267:           raise NameError.new("undefined method `#{m}' for #{self}")
268:         end
269:       end

[Validate]