Sha256: 93514b57c7416270ab0efe43c50be228e16daabad76030268993318f8f3f51d9

Contents?: true

Size: 543 Bytes

Versions: 6

Compression:

Stored size: 543 Bytes

Contents

module GlobalSMS
  class INFO
    def initialize(args)
      @api_key = args[:api_key]
      @api_secret = args[:api_secret]
    end

    def originator_list
      uri = "/originator/list?key=#{@api_key}&secret=#{@api_secret}"
      get_request(uri)
    end

    def user_info
      uri = "/user/info?key=#{@api_key}&secret=#{@api_secret}"
      get_request(uri)
    end

    private

    def get_request(uri)
      client = HTTPClient.new
      response = client.get("#{API_BASE_URL}#{uri}")
      JSON.parse(response.body)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
globalsms-1.0.7 lib/globalsms/info.rb
globalsms-1.0.6 lib/globalsms/info.rb
globalsms-1.0.5 lib/globalsms/info.rb
globalsms-1.0.4 lib/globalsms/info.rb
globalsms-1.0.3 lib/globalsms/info.rb
globalsms-1.0.0 lib/globalsms/info.rb