address.rb
Methods
- ==
- accept
- addr
- addr=
- address
- address=
- address_group?
- domain
- dup
- eql?
- hash
- inspect
- local
- name=
- new
- parse
- phrase=
- spec
- spec=
Included Modules
Attributes
| [R] | name | |
| [R] | routes |
Public Class methods
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 29
29: def initialize( local, domain )
30: if domain
31: domain.each do |s|
32: raise SyntaxError, 'empty word in domain' if s.empty?
33: end
34: end
35: @local = local
36: @domain = domain
37: @name = nil
38: @routes = []
39: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 21
21: def Address.parse( str )
22: Parser.parse :ADDRESS, str
23: end
Public Instance methods
This method is also aliased as
eql?
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 81
81: def ==( other )
82: other.respond_to? :spec and self.spec == other.spec
83: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 100
100: def accept( strategy, dummy1 = nil, dummy2 = nil )
101: unless @local
102: strategy.meta '<>' # empty return-path
103: return
104: end
105:
106: spec_p = (not @name and @routes.empty?)
107: if @name
108: strategy.phrase @name
109: strategy.space
110: end
111: tmp = spec_p ? '' : '<'
112: unless @routes.empty?
113: tmp << @routes.map {|i| '@' + i }.join(',') << ':'
114: end
115: tmp << self.spec
116: tmp << '>' unless spec_p
117: strategy.meta tmp
118: strategy.lwsp ''
119: end
Alias for spec
Alias for spec=
Alias for spec
Alias for spec=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 25
25: def address_group?
26: false
27: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 63
63: def domain
64: return nil unless @domain
65: join_domain(@domain)
66: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 91
91: def dup
92: obj = self.class.new(@local.dup, @domain.dup)
93: obj.name = @name.dup if @name
94: obj.routes.replace @routes
95: obj
96: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 87
87: def hash
88: @local.hash ^ @domain.hash
89: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 53
53: def inspect
54: "#<#{self.class} #{address()}>"
55: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 57
57: def local
58: return nil unless @local
59: return '""' if @local.size == 1 and @local[0].empty?
60: @local.map {|i| quote_atom(i) }.join('.')
61: end
This method is also aliased as
phrase=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 43
43: def name=( str )
44: @name = str
45: @name = nil if str and str.empty?
46: end
Alias for name=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 68
68: def spec
69: s = self.local
70: d = self.domain
71: if s and d
72: s + '@' + d
73: else
74: s
75: end
76: end
[ show source ]
# File lib/action_mailer/vendor/tmail/obsolete.rb, line 71
71: def spec=( str )
72: @local, @domain = str.split(/@/,2).map {|s| s.split(/\./) }
73: end