Module: RCS::AddressbookEvidence
- Defined in:
- lib/rcs-common/evidence/addressbook.rb
Instance Method Summary collapse
Instance Method Details
#content ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rcs-common/evidence/addressbook.rb', line 7 def content fields = { :first_name => ["John", "Liza", "Bruno"].sample, :last_name => ["Doe", "Rossi", "Bianchi"].sample, :mobile_phone_number => "+393380123456", :home_phone_number => "+39024567890", :email_1 => "[email protected]"} AddressBookSerializer.new.serialize fields end |
#decode_content(common_info, chunks) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rcs-common/evidence/addressbook.rb', line 20 def decode_content(common_info, chunks) stream = StringIO.new chunks.join until stream.eof? info = Hash[common_info] info[:data] ||= Hash.new contact = AddressBookSerializer.new.unserialize stream info[:data][:name] = contact.name info[:data][:contact] = contact.contact info[:data][:info] = contact.info info[:data][:program] = contact.program info[:data][:type] = contact.type info[:data][:handles] = contact.handles unless contact.handles.empty? yield info if block_given? end :delete_raw end |
#generate_content ⇒ Object
16 17 18 |
# File 'lib/rcs-common/evidence/addressbook.rb', line 16 def generate_content [ content ] end |