Sha256: a1429859f3283e6ea27da917f6bc478c049a122121bb85a98cfdd2be282e87d9

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

module SipgateIo
  class Dtmf
    include ActiveModel::Validations
    include SipgateIo::EventProcessor

    attr_reader :event, :call_id, :dtmf

    validates :event, :call_id, :dtmf, presence: true
    validates :event, inclusion: { in: %w(dtmf) }
    validates :dtmf, format: { with: /\A\d+\z/ }

    def initialize(params)
      @event = params[:event]
      @call_id = params[:callId]
      @dtmf = params[:dtmf]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sipgate_io-0.3.4 lib/sipgate_io/dtmf.rb
sipgate_io-0.3.3 lib/sipgate_io/dtmf.rb
sipgate_io-0.3.1 lib/sipgate_io/dtmf.rb