Class: Delicious::Tag

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ApiModel
Defined in:
lib/delicious/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ApiModel

#persisted?

Instance Attribute Details

#countObject

Returns the value of attribute count.



8
9
10
# File 'lib/delicious/tag.rb', line 8

def count
  @count
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/delicious/tag.rb', line 8

def name
  @name
end

Instance Method Details

#deleteBoolean

Deletes this tag

Returns:

  • (Boolean)

    ‘true` upon successful deletion, `false` otherwise

Raises:



14
15
16
17
18
19
20
# File 'lib/delicious/tag.rb', line 14

def delete
  if persisted? && @delicious_client
    @delicious_client.tags.delete(name)
  else
    fail Delicious::Error, 'Tag was not saved yet'
  end
end

#to_sObject



22
23
24
# File 'lib/delicious/tag.rb', line 22

def to_s
  %Q(Tag(name: "#{name}", count: #{count}))
end