Module: Mail::CommonField::InstanceMethods

Defined in:
lib/mail/fields/common/common_field.rb

Overview

:doc:

Instance Method Summary collapse

Instance Method Details

#defaultObject



34
35
36
# File 'lib/mail/fields/common/common_field.rb', line 34

def default
  decoded
end

#field_lengthObject



38
39
40
# File 'lib/mail/fields/common/common_field.rb', line 38

def field_length
  @length ||= name.length + value.length + ': '.length
end

#nameObject



15
16
17
# File 'lib/mail/fields/common/common_field.rb', line 15

def name
  @name
end

#name=(value) ⇒ Object



11
12
13
# File 'lib/mail/fields/common/common_field.rb', line 11

def name=(value)
  @name = value
end

#responsible_for?(val) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/mail/fields/common/common_field.rb', line 42

def responsible_for?( val )
  name.to_s.downcase == val.to_s.downcase
end

#to_sObject



30
31
32
# File 'lib/mail/fields/common/common_field.rb', line 30

def to_s
  decoded
end

#valueObject



26
27
28
# File 'lib/mail/fields/common/common_field.rb', line 26

def value
  @value
end

#value=(value) ⇒ Object



19
20
21
22
23
24
# File 'lib/mail/fields/common/common_field.rb', line 19

def value=(value)
  @length = nil
  @tree = nil
  @element = nil
  @value = value
end