Class: ENUtils::NoteList
- Inherits:
-
Array
- Object
- Array
- ENUtils::NoteList
- Defined in:
- lib/evernote_utils/notelist.rb
Instance Attribute Summary collapse
-
#core ⇒ Object
readonly
Returns the value of attribute core.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#get_total_count ⇒ Object
findNoteCounts returns Evernote::EDAM::NoteStore::NoteCollectionCounts notebookCounts:10, …, tagCounts:1, …“.
-
#initialize(core, array, options = {}) ⇒ NoteList
constructor
A new instance of NoteList.
- #total_count ⇒ Object
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, ={}) @core = core @options = super(array) end |
Instance Attribute Details
#core ⇒ Object (readonly)
Returns the value of attribute core.
6 7 8 |
# File 'lib/evernote_utils/notelist.rb', line 6 def core @core end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/evernote_utils/notelist.rb', line 6 def @options end |
Instance Method Details
#get_total_count ⇒ Object
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, ), false) counts.notebookCounts.reduce(0){|sum, pair| sum += pair.last } end |
#total_count ⇒ Object
14 15 16 |
# File 'lib/evernote_utils/notelist.rb', line 14 def total_count @total_count ||= get_total_count end |