lib/sipgate_io/dtmf.rb in sipgate_io-0.3.0 vs lib/sipgate_io/dtmf.rb in sipgate_io-0.3.1

- old
+ new

@@ -1,9 +1,14 @@ 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]