Class: Delicious::Post

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ApiModel

#persisted?

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/delicious/post.rb', line 9

def description
  @description
end

#dtObject

Returns the value of attribute dt.



9
10
11
# File 'lib/delicious/post.rb', line 9

def dt
  @dt
end

#extendedObject

Returns the value of attribute extended.



9
10
11
# File 'lib/delicious/post.rb', line 9

def extended
  @extended
end

#sharedObject

Returns the value of attribute shared.



9
10
11
# File 'lib/delicious/post.rb', line 9

def shared
  @shared
end

#tagsObject

Returns the value of attribute tags.



9
10
11
# File 'lib/delicious/post.rb', line 9

def tags
  @tags
end

#urlObject

Returns the value of attribute url.



9
10
11
# File 'lib/delicious/post.rb', line 9

def url
  @url
end

Instance Method Details

#deleteBoolean

Deletes this bookmark

Returns:

  • (Boolean)

    ‘true` upon successful deletion, `false` otherwise

Raises:



30
31
32
33
34
35
36
# File 'lib/delicious/post.rb', line 30

def delete
  if persisted? && @delicious_client
    @delicious_client.bookmarks.delete url: url
  else
    fail 'Bookmark was not saved yet'
  end
end

#to_sObject



38
39
40
# File 'lib/delicious/post.rb', line 38

def to_s
  %Q(Delicious::Post(url: "#{url}", description: "#{description}", tags: #{tags}, extended: "#{extended}", dt: "#{dt}", shared: #{shared}))
end