Class: Twi::Mock::Phone

Inherits:
Phone show all
Defined in:
lib/twi/mock/phone.rb

Instance Attribute Summary

Attributes inherited from Phone

#id, #number

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Twi::Resource

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
# File 'lib/twi/mock/phone.rb', line 3

def create
  if Twi.mock.phone
    @id = Twi.mock.phone[:id]
    @number = Twi.mock.phone[:number]
  elsif Twi.mock.phone_error
    raise Error, Twi.mock.phone_error
  end
end