Class: Ticard::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/ticard/serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(card) ⇒ Serializer

Returns a new instance of Serializer.



5
6
7
# File 'lib/ticard/serializer.rb', line 5

def initialize(card)
  @card = card
end

Instance Method Details

#serializeObject



9
10
11
12
13
# File 'lib/ticard/serializer.rb', line 9

def serialize
  erb_path = File.join(File.dirname(File.expand_path(__FILE__)), 'card.md.erb')
  template = ERB.new(File.read(erb_path))
  template.result(@card.instance_eval { binding })
end