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()


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

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



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

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)


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

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