Class: KindleClippings::ClippingResult

Inherits:
Array
  • Object
show all
Defined in:
lib/kindleclippings/clippingresult.rb

Instance Method Summary collapse

Instance Method Details

#bookmarksObject



13
14
15
# File 'lib/kindleclippings/clippingresult.rb', line 13

def bookmarks
  filter_by_property(:type, :Bookmark)
end

#by_author(author) ⇒ Object



17
18
19
# File 'lib/kindleclippings/clippingresult.rb', line 17

def by_author(author)
  filter_by_property(:author, author)
end

#by_book(book) ⇒ Object



21
22
23
# File 'lib/kindleclippings/clippingresult.rb', line 21

def by_book(book)
  filter_by_property(:book_title, book)
end

#by_date(from, to) ⇒ Object



25
26
27
28
# File 'lib/kindleclippings/clippingresult.rb', line 25

def by_date(from, to)
  return self unless from && to
  self.select { |annotation| annotation.added_on >= from && annotation.added_on <= to }
end

#highlightsObject



5
6
7
# File 'lib/kindleclippings/clippingresult.rb', line 5

def highlights
  filter_by_property(:type, :Highlight)
end

#notesObject



9
10
11
# File 'lib/kindleclippings/clippingresult.rb', line 9

def notes
  filter_by_property(:type, :Note)
end