Class: Markio::Bookmark

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#add_dateObject

Returns the value of attribute add_date.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def add_date
  @add_date
end

#foldersObject

Returns the value of attribute folders.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def folders
  @folders
end

#hrefObject

Returns the value of attribute href.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def href
  @href
end

#last_modifiedObject

Returns the value of attribute last_modified.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def last_modified
  @last_modified
end

#last_visitObject

Returns the value of attribute last_visit.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def last_visit
  @last_visit
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/markio/bookmark.rb', line 4

def title
  @title
end

Class Method Details

.create(data) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/markio/bookmark.rb', line 6

def self.create data
  bookmark = new
  bookmark.title = data[:title]
  bookmark.href = data[:href]
  bookmark.add_date = data[:add_date] || DateTime.now
  bookmark.last_visit = data[:add_date]
  bookmark.last_modified = data[:last_modified]
  bookmark.folders = data[:folders] || []
  bookmark
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
20
21
# File 'lib/markio/bookmark.rb', line 17

def == other
  unless other.nil? or other.class != self.class
    other.href == href and other.title == title
  end
end