Class: CardDAV::Resource
- Inherits:
-
Object
- Object
- CardDAV::Resource
- Defined in:
- lib/CardDAV/Resource.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#address_data ⇒ Object
Navigation accessors.
- #addressbook_description ⇒ Object
- #href ⇒ Object
-
#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).
- #max_resource_size ⇒ Object
- #propstats ⇒ Object
- #status ⇒ Object
- #supported_address_data ⇒ Object
Instance Attribute Details
#hash ⇒ Object (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_data ⇒ Object
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_description ⇒ Object
29 30 31 |
# File 'lib/CardDAV/Resource.rb', line 29 def addressbook_description property(NAMESPACE, 'addressbook-description') end |
#href ⇒ Object
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.
45 46 47 |
# File 'lib/CardDAV/Resource.rb', line 45 def is_addressbook? resource_type.match?(%r{<(?:\w+:)?addressbook(?:\s[^>]*)?/?>}) end |
#max_resource_size ⇒ Object
37 38 39 |
# File 'lib/CardDAV/Resource.rb', line 37 def max_resource_size property(NAMESPACE, 'max-resource-size') end |
#propstats ⇒ Object
18 19 20 |
# File 'lib/CardDAV/Resource.rb', line 18 def propstats hash[:propstats] end |
#status ⇒ Object
14 15 16 |
# File 'lib/CardDAV/Resource.rb', line 14 def status hash[:status] end |
#supported_address_data ⇒ Object
33 34 35 |
# File 'lib/CardDAV/Resource.rb', line 33 def supported_address_data property(NAMESPACE, 'supported-address-data') end |