Class: Log4ever::Tag

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

Instance Method Summary collapse

Methods inherited from Evernote

#note, #notebook, #tag, #to_ascii

Constructor Details

#initialize(note) ⇒ Tag

Returns a new instance of Tag.



241
242
243
# File 'lib/log4r/evernote.rb', line 241

def initialize(note)
  @note = note
end

Instance Method Details

#clearObject

clear note object



270
271
272
273
# File 'lib/log4r/evernote.rb', line 270

def clear
  @tags = nil
  @tag_guids = nil
end

#getObject

get tag objects



252
253
254
255
256
257
258
259
260
261
# File 'lib/log4r/evernote.rb', line 252

def get
  return if @list.nil? || @list.empty?
  return @tag_guids unless @tag_guids.nil?
  @list = [@list] unless @list.kind_of?(Array)
  @tags = @@note_store.listTags(@@auth_token) if @tags.nil?
  @tag_guids = @list.map do |tag|
    tag_obj = to_obj(tag) || create(tag)
    tag_obj.guid
  end
end

#get!Object

get newest tag objects



264
265
266
267
# File 'lib/log4r/evernote.rb', line 264

def get!
  clear
  get
end

#names=(list) ⇒ Object

set tag list



246
247
248
249
# File 'lib/log4r/evernote.rb', line 246

def names=(list)
  @list = list
  @tag_guids = nil
end