public Method

Mail.[]( key )

Returns a TMail::AddressHeader object of the field you are querying. Examples:

@mail['from']  #=> #<TMail::AddressHeader "mikel@test.com.au">
@mail['to']    #=> #<TMail::AddressHeader "mikel@test.com.au">

You can get the string value of this by passing "to_s" to the query: Example:

@mail['to'].to_s #=> "mikel@test.com.au"

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/mail.rb, line 190
def []( key )
  @header[key.downcase]
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.