Class: Virginity::Vcard::Patching::Add
- Defined in:
- lib/virginity/vcard/patching.rb
Overview
to add a field
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
Instance Method Summary collapse
- #apply(vcard) ⇒ Object
-
#initialize(line) ⇒ Add
constructor
A new instance of Add.
- #pretty_print(q) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Patch
#field_from_query, normalize_vcard!, query_for_line, query_from_string
Constructor Details
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
141 142 143 |
# File 'lib/virginity/vcard/patching.rb', line 141 def field @field end |
Instance Method Details
#apply(vcard) ⇒ Object
146 147 148 |
# File 'lib/virginity/vcard/patching.rb', line 146 def apply(vcard) vcard.add_field(@field) end |
#pretty_print(q) ⇒ Object
154 155 156 |
# File 'lib/virginity/vcard/patching.rb', line 154 def pretty_print(q) q.text "Add #{@field}" end |
#to_s ⇒ Object
150 151 152 |
# File 'lib/virginity/vcard/patching.rb', line 150 def to_s "Add(#{@field.inspect})" end |