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:



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

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.



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

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.decode(decode, card, field) ⇒ Object

:nodoc:



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

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