Class: Evernote2md::Note

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, text) ⇒ Note

Returns a new instance of Note.



20
21
22
23
# File 'lib/evernote2md.rb', line 20

def initialize(title, text)
  @title = title
  @text = Nokogiri::XML(text).xpath('//en-note').first.text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



18
19
20
# File 'lib/evernote2md.rb', line 18

def text
  @text
end

#titleObject

Returns the value of attribute title.



18
19
20
# File 'lib/evernote2md.rb', line 18

def title
  @title
end

Instance Method Details

#to_textObject



25
26
27
# File 'lib/evernote2md.rb', line 25

def to_text
  "#{@title}\n#{@text}"
end