Module: Mail::CommonField

Included in:
StructuredField, UnstructuredField
Defined in:
lib/mail/fields/common/common_field.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#defaultObject


28
29
30
# File 'lib/mail/fields/common/common_field.rb', line 28

def default
  decoded
end

#field_lengthObject


32
33
34
# File 'lib/mail/fields/common/common_field.rb', line 32

def field_length
  @length ||= "#{name}: #{encode(decoded)}".length
end

#nameObject


9
10
11
# File 'lib/mail/fields/common/common_field.rb', line 9

def name
  @name ||= nil
end

#name=(value) ⇒ Object


5
6
7
# File 'lib/mail/fields/common/common_field.rb', line 5

def name=(value)
  @name = value
end

#responsible_for?(val) ⇒ Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/mail/fields/common/common_field.rb', line 36

def responsible_for?( val )
  name.to_s.casecmp(val.to_s) == 0
end

#to_sObject


24
25
26
# File 'lib/mail/fields/common/common_field.rb', line 24

def to_s
  decoded
end

#valueObject


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

def value
  @value
end

#value=(value) ⇒ Object


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

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