class ENUtils::Notebook

Attributes

defaultNotebook[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
guid[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
name[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
restrictions[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
serviceCreated[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
serviceUpdated[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>
updateSequenceNum[R]

Evernote::EDAM::Type::Notebook fields

guid:"afa4ba59-xxxx-42ed-xxxx-zzzzzzzzzzzz"
name:"Books"
updateSequenceNum:24108
defaultNotebook:false
serviceCreated:1297607548000
serviceUpdated:1387262389000
restrictions:<Evernote::EDAM::Type::NotebookRestrictions ...>

Public Class Methods

find_by_guid(core, guid) click to toggle source
# File lib/evernote_utils/notebook.rb, line 30
def self.find_by_guid(core, guid)
  notebook = core.notestore.listNotebooks(core.token).find{|nb| nb.guid == guid }
  notebook.present? ? new(core, notebook) : nil
end
find_by_name(core, name) click to toggle source
# File lib/evernote_utils/notebook.rb, line 35
def self.find_by_name(core, name)
  notebook = core.notestore.listNotebooks(core.token).find{|nb| nb.name.downcase == name.to_s.downcase }
  notebook.present? ? new(core, notebook) : nil
end
new(core, edam_notebook) click to toggle source
# File lib/evernote_utils/notebook.rb, line 15
def initialize(core, edam_notebook)
  @core              = core
  @guid              = edam_notebook.guid
  @name              = edam_notebook.name
  @updateSequenceNum = edam_notebook.updateSequenceNum
  @defaultNotebook   = edam_notebook.defaultNotebook
  @serviceCreated    = Time.at(edam_notebook.serviceCreated/1000)
  @serviceUpdated    = Time.at(edam_notebook.serviceUpdated/1000)
  @restrictions      = edam_notebook.restrictions
end
where(core, options={}) click to toggle source
# File lib/evernote_utils/notebook.rb, line 40
def self.where(core, options={})
  notebooks = core.notestore.listNotebooks(core.token).map{|nb| new(core, nb) }
  return notebooks if options.empty?
  case options[:name]
  when String
    notebooks.select{|nb| options[:name].downcase == nb.name.downcase }
  when Regexp
    notebooks.select{|nb| options[:name] =~ nb.name }
  else
    notebooks
  end
end

Public Instance Methods

notes(options={}) click to toggle source
# File lib/evernote_utils/notebook.rb, line 26
def notes(options={})
  Note.where(@core, options.merge(notebook: self))
end