Class: Lipwig::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/lipwig/parser.rb

Constant Summary collapse

MARKER =
/---\s*/

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Parser

Returns a new instance of Parser.



8
9
10
# File 'lib/lipwig/parser.rb', line 8

def initialize(input)
  @input = input
end

Class Method Details

.call(input) ⇒ Object



4
5
6
# File 'lib/lipwig/parser.rb', line 4

def self.call(input)
  new(input).call
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
# File 'lib/lipwig/parser.rb', line 12

def call
  email = Lipwig::Email.new
  email.from       = frontmatter['from']
  email.subject    = frontmatter['subject']
  email.recipients = frontmatter['recipients']
  email.ccs        = Array frontmatter['cc']
  email.body       = html
  email
end