Class Magnolia::Mark
In: lib/magnolia/magnolia.rb
Parent: Object

The mark class is used to store information about each bookmark after it is found, created or updated. Each method that is not in the DONT_PROCESS constant returns and array of Mark objects.

Methods

a_tag   find   from_xml   img_tag   new   save  

Attributes

a_tag  [R] 
created  [RW] 
description  [RW] 
id  [RW] 
img_tag  [R] 
owner  [RW] 
private  [RW] 
rating  [RW] 
screenshot  [RW] 
tags  [RW] 
title  [RW] 
updated  [RW] 
url  [RW] 

Public Class methods

Finds a single bookmark by it‘s id (short name). If not found raises a Magnolia::RequestError

Converts xml into a mark

Public Instance methods

Creates a link to the url of the bookmark with the title as the text

Creates an image tag for the screenshot image with the title as the alt text

This method allows working with bookmarks much like ActiveRecord.

Examples

  mark = Magnolia::Mark.new
  mark.title = 'Addicted To New'
  mark.url = 'http://addictedtonew.com/'
  mark.tags = ['john nunemaker', 'me'] # you can also use comma-seperated list mark.tags = 'john nunemaker, me'
  mark.save
  puts mark.id # this is the id of the newly created bookmark

You can also use it to update bookmarks like so:

  mark = Magnolia::Mark.find(:id => 'someshortname')
  mark.title = 'Addicted To New by John Nunemaker'
  mark.save

[Validate]