Class: DayoneToQuiver::Converter
- Inherits:
-
Object
- Object
- DayoneToQuiver::Converter
- Defined in:
- lib/dayone_to_quiver/converter.rb
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
Instance Method Summary collapse
-
#initialize(entry, note) ⇒ Converter
constructor
A new instance of Converter.
- #store ⇒ Object
- #with_photo ⇒ Object
Constructor Details
#initialize(entry, note) ⇒ Converter
Returns a new instance of Converter.
5 6 7 8 9 |
# File 'lib/dayone_to_quiver/converter.rb', line 5 def initialize(entry, note) @entry = entry @note = note with_photo if @entry.photo? end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
4 5 6 |
# File 'lib/dayone_to_quiver/converter.rb', line 4 def entry @entry end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
4 5 6 |
# File 'lib/dayone_to_quiver/converter.rb', line 4 def note @note end |
Instance Method Details
#store ⇒ Object
21 22 23 |
# File 'lib/dayone_to_quiver/converter.rb', line 21 def store @note.store end |
#with_photo ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/dayone_to_quiver/converter.rb', line 12 def with_photo @note.src_resources = [@entry.photo] image_url = File.basename(@note.resources.first['dist']) link_str = "![#{image_url}](quiver-image-url/#{image_url})" @note.cells.last['data'] << "\n\n #{link_str}" self end |