Class: Lipwig::Preview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email) ⇒ Preview

Returns a new instance of Preview.



6
7
8
# File 'lib/lipwig/preview.rb', line 6

def initialize(email)
  @email = email
end

Class Method Details

.call(email) ⇒ Object



2
3
4
# File 'lib/lipwig/preview.rb', line 2

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

Instance Method Details

#callObject



10
11
12
13
14
# File 'lib/lipwig/preview.rb', line 10

def call
  File.write filename, email.body

  `open #{filename}`
end