Module: Nokogiri::Decorators::XBEL::Bookmark

Includes:
Entry
Defined in:
lib/nokogiri/decorators/xbel/bookmark.rb

Instance Attribute Summary

Attributes included from Entry

#info

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Entry

#added, #added=, #attributes=, #desc, #desc=, #id, #id=, #initialize_decorator, #title, #title=

Class Method Details

.extended(node) ⇒ Object


5
6
7
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 5

def self.extended(node)
  node.initialize_decorator
end

Instance Method Details

#bookmark?Boolean

:nodoc:

Returns:

  • (Boolean)

38
39
40
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 38

def bookmark? #:nodoc:
  true
end

#hrefObject

Returns href value.


30
31
32
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 30

def href
  if value = self['href'] then value end
end

#href=(value) ⇒ Object

Sets href value.


34
35
36
37
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 34

def href=(value)
  self.modified = Date.today
  self['href'] = value
end

#modifiedObject

Returns modification date.


10
11
12
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 10

def modified
  if value = self['modified'] then Date.parse value end
end

#modified=(value) ⇒ Object

Sets modification date.


14
15
16
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 14

def modified=(value)
  self['modified'] = value.to_s
end

#visitObject

Sets visit to today.


26
27
28
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 26

def visit
  self.visited = Date.today
end

#visitedObject

Returns visit date.


18
19
20
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 18

def visited
  if value = self['visited'] then Date.parse value end
end

#visited=(value) ⇒ Object

Sets visit date.


22
23
24
# File 'lib/nokogiri/decorators/xbel/bookmark.rb', line 22

def visited=(value)
  self['visited'] = value.to_s
end