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 48
48: def initialize( local, domain )
49: if domain
50: domain.each do |s|
51: raise SyntaxError, 'empty word in domain' if s.empty?
52: end
53: end
54: @local = local
55: @domain = domain
56: @name = nil
57: @routes = []
58: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 40
40: def Address.parse( str )
41: Parser.parse :ADDRESS, str
42: end
Public Instance methods
This method is also aliased as
eql?
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 100
100: def ==( other )
101: other.respond_to? :spec and self.spec == other.spec
102: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 119
119: def accept( strategy, dummy1 = nil, dummy2 = nil )
120: unless @local
121: strategy.meta '<>' # empty return-path
122: return
123: end
124:
125: spec_p = (not @name and @routes.empty?)
126: if @name
127: strategy.phrase @name
128: strategy.space
129: end
130: tmp = spec_p ? '' : '<'
131: unless @routes.empty?
132: tmp << @routes.map {|i| '@' + i }.join(',') << ':'
133: end
134: tmp << self.spec
135: tmp << '>' unless spec_p
136: strategy.meta tmp
137: strategy.lwsp ''
138: end
Alias for spec
Alias for spec=
Alias for spec
Alias for spec=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 44
44: def address_group?
45: false
46: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 82
82: def domain
83: return nil unless @domain
84: join_domain(@domain)
85: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 110
110: def dup
111: obj = self.class.new(@local.dup, @domain.dup)
112: obj.name = @name.dup if @name
113: obj.routes.replace @routes
114: obj
115: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 106
106: def hash
107: @local.hash ^ @domain.hash
108: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 72
72: def inspect
73: "#<#{self.class} #{address()}>"
74: end
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 76
76: def local
77: return nil unless @local
78: return '""' if @local.size == 1 and @local[0].empty?
79: @local.map {|i| quote_atom(i) }.join('.')
80: end
This method is also aliased as
phrase=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 62
62: def name=( str )
63: @name = str
64: @name = nil if str and str.empty?
65: end
Alias for name=
[ show source ]
# File lib/action_mailer/vendor/tmail/address.rb, line 87
87: def spec
88: s = self.local
89: d = self.domain
90: if s and d
91: s + '@' + d
92: else
93: s
94: end
95: end
[ show source ]
# File lib/action_mailer/vendor/tmail/obsolete.rb, line 90
90: def spec=( str )
91: @local, @domain = str.split(/@/,2).map {|s| s.split(/\./) }
92: end