Class: Gitlab::Email::ReplyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/email/reply_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ ReplyParser


7
8
9
# File 'lib/gitlab/email/reply_parser.rb', line 7

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message


5
6
7
# File 'lib/gitlab/email/reply_parser.rb', line 5

def message
  @message
end

Instance Method Details

#executeObject


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/gitlab/email/reply_parser.rb', line 11

def execute
  body = select_body(message)

  encoding = body.encoding

  body = discourse_email_trimmer(body)

  body = EmailReplyParser.parse_reply(body)

  body.force_encoding(encoding).encode("UTF-8")
end