Class: ENUtils::NoteList

Inherits:
Array
  • Object
show all
Defined in:
lib/evernote_utils/notelist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(core, array, options = {}) ⇒ NoteList

Returns a new instance of NoteList.



8
9
10
11
12
# File 'lib/evernote_utils/notelist.rb', line 8

def initialize(core, array, options={})
  @core    = core
  @options = options
  super(array)
end

Instance Attribute Details

#coreObject (readonly)

Returns the value of attribute core.



6
7
8
# File 'lib/evernote_utils/notelist.rb', line 6

def core
  @core
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/evernote_utils/notelist.rb', line 6

def options
  @options
end

Instance Method Details

#get_total_countObject

findNoteCounts returns

Evernote::EDAM::NoteStore::NoteCollectionCounts
  notebookCounts:{"xxxxxxxx-...xxx": 10, ...},
  tagCounts:{"xxxxxx-...xxxx": 1, ..."}


22
23
24
25
# File 'lib/evernote_utils/notelist.rb', line 22

def get_total_count
  counts = core.notestore.findNoteCounts(core.token, NoteFilter.build(core, options), false)
  counts.notebookCounts.reduce(0){|sum, pair| sum += pair.last }
end

#total_countObject



14
15
16
# File 'lib/evernote_utils/notelist.rb', line 14

def total_count
  @total_count ||= get_total_count
end