Class: TwilioMock::LookupMocker

Inherits:
Mocker
  • Object
show all
Defined in:
lib/twilio_mock/lookup_mocker.rb

Constant Summary collapse

API_VERSION =
'v1'.freeze
HOST =
'lookups.twilio.com'.freeze

Instance Method Summary collapse

Methods inherited from Mocker

#available_number, #buy_number, #clean, #create_message, #initialize, #messages

Constructor Details

This class inherits a constructor from TwilioMock::Mocker

Instance Method Details

#lookup(number, country_code = nil) ⇒ Object



6
7
8
9
# File 'lib/twilio_mock/lookup_mocker.rb', line 6

def lookup(number, country_code = nil)
  stub_request(:get, "#{base_twilio_url}/PhoneNumbers/#{number}")
    .to_return(status: 200, body: response(number, country_code), headers: {})
end