Class: Bookmark
- Inherits:
-
Object
- Object
- Bookmark
- Defined in:
- lib/zooline/bookmark.rb
Instance Attribute Summary collapse
-
#added ⇒ Object
Public: lets you access the array of items contained within this List.
-
#likes ⇒ Object
Public: lets you access the array of items contained within this List.
-
#permalink ⇒ Object
Public: lets you access the array of items contained within this List.
-
#thumbnail ⇒ Object
Public: lets you access the array of items contained within this List.
-
#tinyurl ⇒ Object
Public: lets you access the array of items contained within this List.
-
#title ⇒ Object
Public: lets you access the array of items contained within this List.
-
#type ⇒ Object
Public: lets you access the array of items contained within this List.
-
#uid ⇒ Object
Public: lets you access the array of items contained within this List.
-
#url ⇒ Object
Public: lets you access the array of items contained within this List.
-
#views ⇒ Object
Public: lets you access the array of items contained within this List.
Class Method Summary collapse
-
.storage ⇒ Object
Returns a Storage instance.
Instance Method Summary collapse
- #getContent ⇒ Object
-
#initialize(bookmark) ⇒ Bookmark
constructor
Public: creates a new List instance in-memory.
- #to_hash ⇒ Object
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
#added ⇒ Object
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 |
#likes ⇒ Object
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 |
#permalink ⇒ Object
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 |
#thumbnail ⇒ Object
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 |
#tinyurl ⇒ Object
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 |
#title ⇒ Object
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 |
#type ⇒ Object
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 |
#uid ⇒ Object
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 |
#url ⇒ Object
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 |
#views ⇒ Object
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
Instance Method Details
#getContent ⇒ Object
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_hash ⇒ Object
31 32 33 |
# File 'lib/zooline/bookmark.rb', line 31 def to_hash { :title => @title, :added => @added, :title => @title, :content => getContent } end |