Class: CardDAV::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/CardDAV/Resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



8
9
10
# File 'lib/CardDAV/Resource.rb', line 8

def hash
  @hash
end

Instance Method Details

#address_dataObject

Navigation accessors. Strictly navigation, not parsing: they return the underlying vCard string or value.



25
26
27
# File 'lib/CardDAV/Resource.rb', line 25

def address_data
  property(NAMESPACE, 'address-data')
end

#addressbook_descriptionObject



29
30
31
# File 'lib/CardDAV/Resource.rb', line 29

def addressbook_description
  property(NAMESPACE, 'addressbook-description')
end

#hrefObject



10
11
12
# File 'lib/CardDAV/Resource.rb', line 10

def href
  hash[:href]
end

#is_addressbook?Boolean

Matches an <addressbook> element (under any namespace prefix) in the serialised resourcetype, rather than a bare ‘addressbook’ substring (RFC 6352 §5.2). There is no addressbook-proxy collision as there is for calendars, but the namespaced-element match is kept for symmetry and safety.

Returns:

  • (Boolean)


45
46
47
# File 'lib/CardDAV/Resource.rb', line 45

def is_addressbook?
  resource_type.match?(%r{<(?:\w+:)?addressbook(?:\s[^>]*)?/?>})
end

#max_resource_sizeObject



37
38
39
# File 'lib/CardDAV/Resource.rb', line 37

def max_resource_size
  property(NAMESPACE, 'max-resource-size')
end

#propstatsObject



18
19
20
# File 'lib/CardDAV/Resource.rb', line 18

def propstats
  hash[:propstats]
end

#statusObject



14
15
16
# File 'lib/CardDAV/Resource.rb', line 14

def status
  hash[:status]
end

#supported_address_dataObject



33
34
35
# File 'lib/CardDAV/Resource.rb', line 33

def supported_address_data
  property(NAMESPACE, 'supported-address-data')
end