Class: Vpim::Vcard::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/vpim/vcard.rb

Overview

An entry in a vCard. The #value object’s type varies with the kind of line (the #name), and on how the line was encoded. The objects returned for a specific kind of line are often extended so that they support a common set of methods. The goal is to allow all types of objects for a kind of line to be treated with some uniformity, but still allow specific handling for the various value types if desired.

See the specific methods for details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group, name, value) ⇒ Line

:nodoc:



574
575
576
# File 'lib/vpim/vcard.rb', line 574

def initialize(group, name, value) #:nodoc:
  @group, @name, @value = (group||''), name.to_str, value
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



570
571
572
# File 'lib/vpim/vcard.rb', line 570

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



571
572
573
# File 'lib/vpim/vcard.rb', line 571

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



572
573
574
# File 'lib/vpim/vcard.rb', line 572

def value
  @value
end

Class Method Details

.decode(decode, card, field) ⇒ Object

:nodoc:



578
579
580
# File 'lib/vpim/vcard.rb', line 578

def self.decode(decode, card, field) #:nodoc:
  card.cache[field] || (card.cache[field] = card.send(decode[field.name], field))
end