class Evertils::Common::Entity::Tag

Public Instance Methods

create(name) click to toggle source

@since 0.2.0

# File lib/evertils/common/entity/tag.rb, line 18
def create(name)
  tag = ::Evernote::EDAM::Type::Tag.new
  tag.name = name

  @entity = @evernote.call(:createTag, tag)

  self if @entity
end
expunge(name) click to toggle source

@since 0.2.0 @deprecated 0.2.9

# File lib/evertils/common/entity/tag.rb, line 36
def expunge(name)
  deprecation_notice('0.2.9', 'Replaced with Entity#expunge!  Will be removed in 0.4.0.')
  tag = find(name)

  @evernote.call(:expungeTag, tag.guid)
end
expunge!() click to toggle source

@since 0.2.9

# File lib/evertils/common/entity/tag.rb, line 29
def expunge!
  @evernote.call(:expungeTag, @entity.guid)
end
find(name) click to toggle source

@since 0.2.0

# File lib/evertils/common/entity/tag.rb, line 7
def find(name)
  @entity = nil
  tags = Tags.new.all

  @entity = tags.detect { |tag| tag.name == name }

  self if @entity
end