<commit_before>require 'chutki/version'
require 'httparty'

class Chutki
  include HTTParty
  base_uri "http://prosms.easy2approach.com"

  def initialize(options)
    @options = options
    @username = options[:user]
    @password = options[:password]
    @sender_id = options[:sender]
  end

  def send_sms(message,to,opts = {})
    opts ||= {}
    opts[:mobiles] = to
    opts[:message] = message
    makesend("/sendhttp.php",opts)
  end

  def deliver(mail)
    send_sms(mail.body,mail.to[0])
  end

  def deliver!(mail)
    deliver(mail)
  end

  def check_dnd_balance
    balance("dnd")
  end

  def voice_balance
    balance("voice")
  end

  def balance(type = nil)
    opts = {}
    if type && (["dnd","voice"].include?(type))
      opts[:type] = type
    end
    makesend("/api/balance.php",opts)
  end

  def change_password(new_password)
    makesend("/api/change_password.php",{:newpass => new_password})
  end

  def validation
    makesend("/api/validate.php")
  end

  def check_delivery_report(msgid)
    makesend("/api/check_delivery.php",:msgid => msgid)
  end

  private

    def makesend(endpoint,opts = {})
      self.class.post(endpoint,opts.merge(@options))
    end

end<commit_msg>try this<commit_after>require 'chutki/version'
require 'httparty'

class Chutki
  include HTTParty
  base_uri "http://prosms.easy2approach.com"

  def initialize(options)
    @options = options
    @username = options[:user]
    @password = options[:password]
    @sender_id = options[:sender]
  end

  def send_sms(message,to,opts = {})
    opts ||= {}
    opts[:mobiles] = to
    opts[:message] = message
    makesend("/sendhttp.php",opts)
  end

  def deliver(mail)
    send_sms(mail.body,mail.to[0])
  end

  def deliver!(mail)
    deliver(mail)
  end

  def check_dnd_balance
    balance("dnd")
  end

  def voice_balance
    balance("voice")
  end

  def balance(type = nil)
    opts = {}
    if type && (["dnd","voice"].include?(type))
      opts[:type] = type
    end
    makesend("/api/balance.php",opts)
  end

  def change_password(new_password)
    makesend("/api/change_password.php",{:newpass => new_password})
  end

  def validation
    makesend("/api/validate.php")
  end

  def check_delivery_report(msgid)
    makesend("/api/check_delivery.php",:msgid => msgid)
  end

  private

    def makesend(endpoint,opts = {})
      self.class.post(endpoint,:query => {opts.merge(@options)})
    end

end
{'fraction_non_alphanumeric': 0.13931376601901613, 'fraction_numerical': 0.0016535758577924762, 'mean_word_length': 3.336917562724014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1012059', 'n_tokens_mistral': 857, 'n_tokens_neox': 831, 'n_words': 157}