Class: Karasuba
- Inherits:
-
Object
- Object
- Karasuba
- Defined in:
- lib/karasuba.rb,
lib/karasuba/link.rb,
lib/karasuba/note.rb,
lib/karasuba/todo.rb,
lib/karasuba/parser.rb,
lib/karasuba/version.rb,
lib/karasuba/link_appender.rb,
lib/karasuba/footer_appender.rb
Defined Under Namespace
Classes: FooterAppender, Link, LinkAppender, Note, Parser, Todo
Constant Summary collapse
- VERSION =
'0.0.3'
Instance Attribute Summary collapse
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #equivalent?(doc_or_string) ⇒ Boolean
-
#initialize(note_or_string, options = {}) ⇒ Karasuba
constructor
A new instance of Karasuba.
- #todos ⇒ Object
Constructor Details
#initialize(note_or_string, options = {}) ⇒ Karasuba
Returns a new instance of Karasuba.
18 19 20 21 22 23 24 25 |
# File 'lib/karasuba.rb', line 18 def initialize(note_or_string, = {}) @xml = if note_or_string.respond_to?(:content) Nokogiri.parse(note_or_string.content) else Nokogiri.parse(note_or_string) end @note = Note.new(xml, ) end |
Instance Attribute Details
#note ⇒ Object (readonly)
Returns the value of attribute note.
13 14 15 |
# File 'lib/karasuba.rb', line 13 def note @note end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
13 14 15 |
# File 'lib/karasuba.rb', line 13 def xml @xml end |
Instance Method Details
#equivalent?(doc_or_string) ⇒ Boolean
27 28 29 |
# File 'lib/karasuba.rb', line 27 def equivalent?(doc_or_string) note.equivalent?(doc_or_string) end |
#todos ⇒ Object
31 32 33 |
# File 'lib/karasuba.rb', line 31 def todos note.todos end |