Module: Nokogiri::Decorators::XBEL::Alias

Extended by:
Forwardable
Defined in:
lib/nokogiri/decorators/xbel/alias.rb

Instance Method Summary collapse

Instance Method Details

#alias?Boolean

:nodoc:

Returns:

  • (Boolean)

27
28
29
# File 'lib/nokogiri/decorators/xbel/alias.rb', line 27

def alias? #:nodoc:
  true
end

#entryObject

Returns referenced bookmark or folder.


19
20
21
# File 'lib/nokogiri/decorators/xbel/alias.rb', line 19

def entry
  at %Q'//*[@id="#{ ref }"]'
end

#entry=(bookmark_or_folder) ⇒ Object

Sets referenced bookmark or folder.


23
24
25
# File 'lib/nokogiri/decorators/xbel/alias.rb', line 23

def entry=(bookmark_or_folder)
  self.ref = bookmark_or_folder.id
end

#refObject Also known as: reference

Returns reference to bookmark or folder id.


8
9
10
# File 'lib/nokogiri/decorators/xbel/alias.rb', line 8

def ref
  attribute('ref').content
end

#ref=(bookmark_or_folder_id) ⇒ Object Also known as: reference=

Sets reference of bookmark or folder id.


12
13
14
# File 'lib/nokogiri/decorators/xbel/alias.rb', line 12

def ref=(bookmark_or_folder_id)
  set_attribute 'ref', bookmark_or_folder_id.to_s
end