Class: Markio::Bookmark
- Inherits:
-
Object
- Object
- Markio::Bookmark
- Defined in:
- lib/markio/bookmark.rb
Instance Attribute Summary collapse
-
#add_date ⇒ Object
Returns the value of attribute add_date.
-
#folders ⇒ Object
Returns the value of attribute folders.
-
#href ⇒ Object
Returns the value of attribute href.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#last_visit ⇒ Object
Returns the value of attribute last_visit.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#add_date ⇒ Object
Returns the value of attribute add_date.
4 5 6 |
# File 'lib/markio/bookmark.rb', line 4 def add_date @add_date end |
#folders ⇒ Object
Returns the value of attribute folders.
4 5 6 |
# File 'lib/markio/bookmark.rb', line 4 def folders @folders end |
#href ⇒ Object
Returns the value of attribute href.
4 5 6 |
# File 'lib/markio/bookmark.rb', line 4 def href @href end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
4 5 6 |
# File 'lib/markio/bookmark.rb', line 4 def last_modified @last_modified end |
#last_visit ⇒ Object
Returns the value of attribute last_visit.
4 5 6 |
# File 'lib/markio/bookmark.rb', line 4 def last_visit @last_visit end |
#title ⇒ Object
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 |