Module: Virginity::Vcard::Patching

Included in:
Virginity::Vcard
Defined in:
lib/virginity/vcard/patching.rb

Overview

before: TEL;TYPE=HOME:1234 after: TEL;TYPE=WORK:1233 — someone removed the home phone and added a new number for work — remove(“TEL:1234”) add(“TEL;TYPE=WORK:1233”)

Defined Under Namespace

Classes: Add, Diff, IllegalPatch, Patch, Remove, Update

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.diff(before_card, after_card) ⇒ Object



32
33
34
# File 'lib/virginity/vcard/patching.rb', line 32

def self.diff(before_card, after_card)
  Diff.diff(before_card, after_card)
end

Instance Method Details

#patch!(diff) ⇒ Object



27
28
29
30
# File 'lib/virginity/vcard/patching.rb', line 27

def patch!(diff)
  diff.apply(self)
  self
end