class KaveRestApi::SelectOutBox

Attributes

enddate[RW]
response[R]
sender[RW]
startdate[RW]

Public Class Methods

new(args = {}) click to toggle source
Calls superclass method KaveRestApi::RequestBase::new
# File lib/kave_rest_api/requests/selectoutbox.rb, line 12
def initialize(args = {})
  super
  @ACTION_NAME    = [:selectoutbox,@FORMAT].join('.').freeze
  @startdate   = args.fetch(:startdate)
  @enddate     = args.fetch(:enddate,nil)
  @sender      = args.fetch(:sender,nil)
  @response    = ResponseSelectOutBox.new
end

Public Instance Methods

call() click to toggle source
# File lib/kave_rest_api/requests/selectoutbox.rb, line 21
def call
    connection = Faraday.new(url: "#{API_URL}/sms/") do |faraday|
      faraday.adapter Faraday.default_adapter
      faraday.response FORMAT.to_sym
    end
     response = connection.get(ACTION_NAME, sender: @sender,startdate: @startdate,enddate: @enddate)
     @response.validate(response.body)
end