Class: Mock::Twilio::Decorators::Api2010::IncomingPhoneNumbers

Inherits:
Object
  • Object
show all
Extended by:
Generator
Defined in:
lib/mock/twilio/decorators/api_2010/incoming_phone_numbers.rb

Class Method Summary collapse

Methods included from Generator

friendly_number_generator, phone_number_generator, random_account_sid, random_address_sid, random_assignment_sid, random_bundle_sid, random_identity_sid, random_latitude, random_longitude, random_phone_number_sid, random_twiml_app_sid

Class Method Details

.decorate(body, request) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mock/twilio/decorators/api_2010/incoming_phone_numbers.rb', line 11

def decorate(body, request)
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
  body["date_created"] = Time.current.rfc2822 if body["date_created"]
  body["account_sid"] = ::Twilio. if body["account_sid"]

  body["sid"] = random_phone_number_sid if body["sid"]
  body["identity_sid"] = random_identity_sid if body["identity_sid"]
  body["emergency_address_sid"] = random_address_sid if body["emergency_address_sid"]
  body["address_sid"] = random_address_sid if body["address_sid"]
  body["bundle_sid"] = random_bundle_sid if body["bundle_sid"]

  body
end