Class: TreeCard::Attribute
- Inherits:
-
Object
- Object
- TreeCard::Attribute
- Defined in:
- lib/treecard/attribute.rb
Overview
A line in the VCard file.
* +name+ is the name of the attribute, like 'fn', 'adr', etc.
* +param+ is a list of +TreeCard::Param+ objects, representing each
parameter associated with this attribute
* +value+ is the raw text of the attribute's value. It is up to
the caller to parse, if necessary.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, params, value) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, params, value) ⇒ Attribute
Returns a new instance of Attribute.
12 13 14 15 16 17 18 19 |
# File 'lib/treecard/attribute.rb', line 12 def initialize(name, params, value) @name = name @params = {} params.each do |param| @params[param.name.downcase] = param end @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/treecard/attribute.rb', line 10 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/treecard/attribute.rb', line 10 def params @params end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/treecard/attribute.rb', line 10 def value @value end |