Method: RMail::Header#replace

Defined in:
lib/rmail/header.rb

#replace(other) ⇒ Object

Replaces the contents of this header with that of another header object. Returns self.



182
183
184
185
186
187
188
189
190
# File 'lib/rmail/header.rb', line 182

def replace(other)
  unless other.kind_of?(RMail::Header)
    raise TypeError, "#{other.class.to_s} is not of type RMail::Header"
  end
  temp = other.dup
  @fields = temp.fields
  @mbox_from = temp.mbox_from
  self
end