Class: Vcard::Vcard::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/vcard/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:



554
555
556
# File 'lib/vcard/vcard.rb', line 554

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.



550
551
552
# File 'lib/vcard/vcard.rb', line 550

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



551
552
553
# File 'lib/vcard/vcard.rb', line 551

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



552
553
554
# File 'lib/vcard/vcard.rb', line 552

def value
  @value
end

Class Method Details

.decode(decode, card, field) ⇒ Object

:nodoc:



558
559
560
# File 'lib/vcard/vcard.rb', line 558

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