Class: Bookmark

Inherits:
Object
  • Object
show all
Defined in:
lib/zooline/bookmark.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bookmark) ⇒ Bookmark

Public: creates a new List instance in-memory.

name - The name of the List. Fails if already used.

Returns the unpersisted List instance.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/zooline/bookmark.rb', line 8

def initialize(bookmark)
  @title     = bookmark['title']
  @url       = bookmark['url']
  @uid       = bookmark['uid']
  @added     = bookmark['added']
  @type      = bookmark['type']
  @views     = bookmark['views']
  @likes     = bookmark['likes']
  @permalink = bookmark['permalink']
  @tinyurl   = bookmark['tinyurl']
  @thumbnail = bookmark['thumbnail']
end

Instance Attribute Details

#addedObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def added
  @added
end

#likesObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def likes
  @likes
end

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def permalink
  @permalink
end

#thumbnailObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def thumbnail
  @thumbnail
end

#tinyurlObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def tinyurl
  @tinyurl
end

#titleObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def title
  @title
end

#typeObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def type
  @type
end

#uidObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def uid
  @uid
end

#urlObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def url
  @url
end

#viewsObject

Public: lets you access the array of items contained within this List.

Returns an Array of Items.



29
30
31
# File 'lib/zooline/bookmark.rb', line 29

def views
  @views
end

Class Method Details

.storageObject

Returns a Storage instance.



22
23
24
# File 'lib/zooline/bookmark.rb', line 22

def self.storage
  Zooline.storage
end

Instance Method Details

#getContentObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/zooline/bookmark.rb', line 35

def getContent
  {
    :title => @title,
    :url   => @url,  
    :uid   => @uid,  
    :added => @added,
    :type  => @type, 
    :views => @views,
    :likes => @likes,
    :permalink => @permalink,
    :tinyurl   => @tinyurl,  
    :thumbnail => @thumbnail
  }
end

#to_hashObject



31
32
33
# File 'lib/zooline/bookmark.rb', line 31

def to_hash
  { :title => @title, :added => @added, :title => @title, :content => getContent }
end