Class: ENUtils::Core
- Inherits:
-
Object
- Object
- ENUtils::Core
- Defined in:
- lib/evernote_utils.rb
Instance Attribute Summary collapse
-
#notestore ⇒ Object
Returns the value of attribute notestore.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token, production = true) ⇒ Core
constructor
A new instance of Core.
- #notebooks(options = {}) ⇒ Object
- #notes(options = {}) ⇒ Object
- #tags(options = {}) ⇒ Object
Constructor Details
#initialize(token, production = true) ⇒ Core
Returns a new instance of Core.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/evernote_utils.rb', line 14 def initialize(token, production=true) userStoreUrl = "https://#{production ? 'www' : 'sandbox'}.evernote.com/edam/user" userStoreTransport = Thrift::HTTPClientTransport.new(userStoreUrl) userStoreProtocol = Thrift::BinaryProtocol.new(userStoreTransport) userStore = Evernote::EDAM::UserStore::UserStore::Client.new(userStoreProtocol) versionOK = userStore.checkVersion("Evernote EDAMTest (Ruby)", Evernote::EDAM::UserStore::EDAM_VERSION_MAJOR, Evernote::EDAM::UserStore::EDAM_VERSION_MINOR) raise InvalidVersion unless versionOK noteStoreUrl = userStore.getNoteStoreUrl(token) noteStoreTransport = Thrift::HTTPClientTransport.new(noteStoreUrl) noteStoreProtocol = Thrift::BinaryProtocol.new(noteStoreTransport) @notestore = Evernote::EDAM::NoteStore::NoteStore::Client.new(noteStoreProtocol) @token = token end |
Instance Attribute Details
#notestore ⇒ Object
Returns the value of attribute notestore.
12 13 14 |
# File 'lib/evernote_utils.rb', line 12 def notestore @notestore end |
#token ⇒ Object
Returns the value of attribute token.
12 13 14 |
# File 'lib/evernote_utils.rb', line 12 def token @token end |