Class: Log4ever::Evernote

Inherits:
Object
  • Object
show all
Defined in:
lib/log4r/evernote.rb

Constant Summary collapse

@@auth_store =
nil

Instance Method Summary collapse

Constructor Details

#initialize(auth_token, is_sandbox = false) ⇒ Evernote

Execute authentication to evernote



33
34
35
36
37
# File 'lib/log4r/evernote.rb', line 33

def initialize(auth_token, is_sandbox = false)
  if @@auth_store.nil?
    @@auth_store = EvernoteAuth.new(auth_token, is_sandbox)
  end
end

Instance Method Details

#note(notebook) ⇒ Object

get registered note or create new note



47
48
49
50
# File 'lib/log4r/evernote.rb', line 47

def note(notebook)
  @note = Note.new(notebook, @@auth_store) if @note.nil?
  @note
end

#notebookObject

get registered notebook or create new notebook search the notebook under the stack if stack_name specific



41
42
43
44
# File 'lib/log4r/evernote.rb', line 41

def notebook
  @notebook = Notebook.new(@@auth_store) if @notebook.nil?
  @notebook
end

#tag(note) ⇒ Object

get registered tag or create new tag



53
54
55
56
# File 'lib/log4r/evernote.rb', line 53

def tag(note)
  @tag = Tag.new(note, @@auth_store) if @tag.nil?
  @tag
end