Sha256: 7cbdf0f1d8c3c8d258adb932273540929258cc1cdd7bce8bf7844d6b7594a292

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

# Performs sender operation
require_relative "termii"
require_relative "client"

module TermiiRuby
  #
  # @author Collins Ugwu
  # Sender Class for creating and fetching the sender ID
  #
  class Sender < TermiiRuby::Termii
    def initialize(api_key)
      super()
      @client = TermiiRuby::Client.new(api_key)
    end

    #
    # Create a Sender ID
    #
    # @param [String] sender_id Represents the ID of the sender which can be alphanumeric or numeric
    # @param [String] usecase A sample of the type of message sent.
    # @param [String] company Represents the name of the company with the sender ID.
    #
    # @return [JSON] JSON object
    #
    def create_sender(sender_id, usecase, company)
      data = {
        sender_id: sender_id,
        usecase: usecase,
        company: company
      }
      @client.make_post_request(CREATE_SENDER, data)
    end

    #
    # A Sender ID is the name or number that identifies the sender of an SMS message.
    #
    # @return [JSON] JSON object
    #
    def fetch_senders
      @client.make_get_request(FETCH_SENDER)
    end

    def verify; end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
termii_ruby-0.1.1 lib/termii_ruby/sender.rb