Module: BulkgateSmsGatewayContract::FileLog

Defined in:
lib/bulkgate_sms_gateway_contract/file_log.rb

Class Method Summary collapse

Class Method Details

._loggerObject



12
13
14
# File 'lib/bulkgate_sms_gateway_contract/file_log.rb', line 12

def self._logger
  @_logger ||= Logger.new(Rails.root.join('log', 'sms.log'))
end

.send_sms(number:, country:, body:, sender_name: nil) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/bulkgate_sms_gateway_contract/file_log.rb', line 3

def self.send_sms(number:, country:, body:, sender_name: nil)
  BulkgateSmsGatewayContract::FakeContractCommonalities
    .raise_when_invalid(country: country, body: body, number: number)

  msg = "BULKGATE: #{country}:#{number} - #{body}"
  msg += " | SENDER:#{sender_name}"
  _logger.info(msg)
end