Class: Dkim::DkimHeader

Inherits:
Header
  • Object
show all
Defined in:
lib/dkim/dkim_header.rb

Instance Attribute Summary collapse

Attributes inherited from Header

#key

Instance Method Summary collapse

Methods inherited from Header

#canonical_relaxed, #canonical_simple, parse, #relaxed_key, #relaxed_value

Methods included from Canonicalizable

#to_s

Constructor Details

#initialize(values = {}) ⇒ DkimHeader

Returns a new instance of DkimHeader.



9
10
11
12
# File 'lib/dkim/dkim_header.rb', line 9

def initialize values={}
  self.key = 'DKIM-Signature'
  @list = TagValueList.new values
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



8
9
10
# File 'lib/dkim/dkim_header.rb', line 8

def list
  @list
end

Instance Method Details

#[](k) ⇒ Object



16
17
18
# File 'lib/dkim/dkim_header.rb', line 16

def [] k
  encoder_for(k).decode(@list[k])
end

#[]=(k, v) ⇒ Object



19
20
21
# File 'lib/dkim/dkim_header.rb', line 19

def []= k, v
  @list[k] = encoder_for(k).encode(v)
end

#valueObject



13
14
15
# File 'lib/dkim/dkim_header.rb', line 13

def value
  " #{@list}"
end