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



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

def default
  decoded
end

#field_lengthObject



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

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

#nameObject



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

def name
  @name
end

#name=(value) ⇒ Object



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

def name=(value)
  @name = value
end

#responsible_for?(val) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#to_sObject



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

def to_s
  decoded
end

#valueObject



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

def value
  @value
end

#value=(value) ⇒ Object



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

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