Sha256: eca6137c934a001c7660a100c29148a5784198c661f3a2ea4c5bb72ab3919fd6

Contents?: true

Size: 935 Bytes

Versions: 20

Compression:

Stored size: 935 Bytes

Contents

module Evertils
  module Common
    module Entity
      class Tag < Entity::Base
        #
        # @since 0.2.0
        def find(name)
          @entity = nil
          tags = Tags.new.all

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

          self if @entity
        end

        #
        # @since 0.2.0
        def create(name)
          tag = ::Evernote::EDAM::Type::Tag.new
          tag.name = name

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

          self if @entity
        end

        #
        # @since 0.2.9
        def expunge!
          @evernote.call(:expungeTag, @entity.guid)
        end

        #
        # @since 0.2.0
        # @deprecated 0.2.9
        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
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
evertils-common-0.3.18 lib/evertils/common/entity/tag.rb
evertils-common-0.3.17 lib/evertils/common/entity/tag.rb
evertils-common-0.3.16 lib/evertils/common/entity/tag.rb
evertils-common-0.3.15 lib/evertils/common/entity/tag.rb
evertils-common-0.3.14 lib/evertils/common/entity/tag.rb
evertils-common-0.3.13 lib/evertils/common/entity/tag.rb
evertils-common-0.3.12 lib/evertils/common/entity/tag.rb
evertils-common-0.3.11 lib/evertils/common/entity/tag.rb
evertils-common-0.3.10 lib/evertils/common/entity/tag.rb
evertils-common-0.3.9 lib/evertils/common/entity/tag.rb
evertils-common-0.3.8 lib/evertils/common/entity/tag.rb
evertils-common-0.3.7 lib/evertils/common/entity/tag.rb
evertils-common-0.3.6 lib/evertils/common/entity/tag.rb
evertils-common-0.3.5 lib/evertils/common/entity/tag.rb
evertils-common-0.3.4.1 lib/evertils/common/entity/tag.rb
evertils-common-0.3.4 lib/evertils/common/entity/tag.rb
evertils-common-0.3.4.1.pre.dev lib/evertils/common/entity/tag.rb
evertils-common-0.3.3.1 lib/evertils/common/entity/tag.rb
evertils-common-0.3.3 lib/evertils/common/entity/tag.rb
evertils-common-0.3.2 lib/evertils/common/entity/tag.rb