Sha256: b85b0f380db329426a8114e975d7f461b6d2833803a1fbf84082980570ca99ce
Contents?: true
Size: 1.01 KB
Versions: 4
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module TwilioBase module Fake class VoiceCall Call = Struct.new(:sid, :attributes) do def from attributes[:from] end def status attributes[:status] end def to attributes[:to] end def update(attributes) self.attributes = attributes end end cattr_accessor :calls, :sid self.calls = [] def initialize(sid = FactoryBot.generate(:voice_call_sid)) self.sid = sid end def create(args = {}) call = Call.new(sid, args) calls << call call end def list(attributes = {}) calls.select do |call| call.attributes.slice(*attributes.keys) == attributes end end def fetch calls.detect { |call| call.sid == sid } end def update(*); end def recordings(recording_sid = nil) TwilioBase::Fake::Recording.new(recording_sid) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems