Class: Hpricot::Elem

Inherits:
Object
  • Object
show all
Defined in:
lib/davclient/hpricot_extensions.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object

Makes properties available as simple method calls.

Example:

print item.creationdate()


16
17
18
19
20
21
# File 'lib/davclient/hpricot_extensions.rb', line 16

def method_missing(method_name, *args)
  if(args.size == 0) then
    return property(method_name.to_s)
  end
  raise "Method missing"
end

Instance Method Details

#hrefObject

Resource url



24
25
26
# File 'lib/davclient/hpricot_extensions.rb', line 24

def href()
  self.at("d:href").innerText
end

#isCollection?Boolean

Returns true of resource is a collection, i.e. a folder and not a file.

Returns:

  • (Boolean)


29
30
31
# File 'lib/davclient/hpricot_extensions.rb', line 29

def isCollection?()
  self.at("d:collection") != nil
end