Class: Ticard::Serializer
- Inherits:
-
Object
- Object
- Ticard::Serializer
- Defined in:
- lib/ticard/serializer.rb
Instance Method Summary collapse
-
#initialize(card) ⇒ Serializer
constructor
A new instance of Serializer.
- #serialize ⇒ Object
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
#serialize ⇒ Object
9 10 11 12 13 |
# File 'lib/ticard/serializer.rb', line 9 def serialize erb_path = File.join(File.dirname(File.(__FILE__)), 'card.md.erb') template = ERB.new(File.read(erb_path)) template.result(@card.instance_eval { binding }) end |