Class: Log4ever::Tag

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

Instance Method Summary collapse

Constructor Details

#initialize(note, auth_store) ⇒ Tag

Returns a new instance of Tag.



236
237
238
239
# File 'lib/log4r/evernote.rb', line 236

def initialize(note, auth_store)
  @note = note
  @auth_store = auth_store
end

Instance Method Details

#getObject

get tag objects



248
249
250
251
252
253
254
255
256
257
# File 'lib/log4r/evernote.rb', line 248

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

#names=(list) ⇒ Object

set tag list



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

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