Module: EvernoteOAuth::BusinessUtils
- Includes:
- BusinessNoteStore, NoteStore, SharedNoteStore, UserStore
- Included in:
- Client
- Defined in:
- lib/evernote_oauth/business_utils.rb
Instance Method Summary collapse
-
#create_business_notebook(notebook) ⇒ Evernote::EDAM::Type::LinkedNotebook
Creates a business notebook in the business account and LinkedNotebook for the user.
-
#create_note_in_business_notebook(note, business_notebook) ⇒ Evernote::EDAM::Type::Note
Creates a note in the given business notebook.
-
#get_corresponding_notebook(business_notebook) ⇒ Evernote::EDAM::Type::Notebook
Get a notebook object corresponding to the given business notebook.
-
#list_business_notebooks ⇒ Array<Evernote::EDAM::Type::LinkedNotebook>
Lists all business notebooks the user can access.
Methods included from BusinessNoteStore
Methods included from UserStore
Methods included from SharedNoteStore
Methods included from NoteStore
Instance Method Details
#create_business_notebook(notebook) ⇒ Evernote::EDAM::Type::LinkedNotebook
Creates a business notebook in the business account and LinkedNotebook for the user.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/evernote_oauth/business_utils.rb', line 31 def create_business_notebook(notebook) business_notebook = business_note_store.createNotebook(notebook) shared_notebook = business_notebook.sharedNotebooks.first business_user = business_note_store.user linked_notebook = Evernote::EDAM::Type::LinkedNotebook.new( shareKey: shared_notebook.shareKey, shareName: business_notebook.name, username: business_user.username, shardId: business_user.shardId ) note_store.createLinkedNotebook(linked_notebook) end |
#create_note_in_business_notebook(note, business_notebook) ⇒ Evernote::EDAM::Type::Note
Creates a note in the given business notebook.
14 15 16 17 18 |
# File 'lib/evernote_oauth/business_utils.rb', line 14 def create_note_in_business_notebook(note, business_notebook) shared_notebook = shared_note_store(business_notebook).getSharedNotebookByAuth note.notebookGuid = shared_notebook.notebookGuid shared_note_store(business_notebook).createNote(note) end |
#get_corresponding_notebook(business_notebook) ⇒ Evernote::EDAM::Type::Notebook
Get a notebook object corresponding to the given business notebook.
48 49 50 51 |
# File 'lib/evernote_oauth/business_utils.rb', line 48 def get_corresponding_notebook(business_notebook) shared_notebook = shared_note_store(business_notebook).getSharedNotebookByAuth business_note_store.getNotebook(shared_notebook.notebookGuid) end |
#list_business_notebooks ⇒ Array<Evernote::EDAM::Type::LinkedNotebook>
Lists all business notebooks the user can access.
23 24 25 |
# File 'lib/evernote_oauth/business_utils.rb', line 23 def list_business_notebooks note_store.listLinkedNotebooks.select(&:businessId) end |