Sha256: ab5790a9c96e92dc88f7adfa4e460f6be409ce7c014d880f30e56a798de6c980

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

require "imperituroard/version"
require "imperituroard/phpipamdb"
require "imperituroard/phpipamcps"

module Imperituroard
  class Error < StandardError; end

  def initialize()
  end

  def hhh(jjj)
    p jjj
  end
  # Your code goes here...
end

module Phpipam
  def test(ggg)
    p ggg
  end
end

class Pipam

  attr_accessor :username, :password, :ip, :database_class, :cps_class
  def initialize(db_username, db_password, db_ip, cps_wsdl, cps_endpoint, cps_namespace)
    @username = db_username
    @password = db_password
    @ip = db_ip
    @database_class = Pdb.new("phpipam", db_username, db_password, db_ip, "3306")
    @cps_class = Pcps.new(cps_wsdl, cps_endpoint, cps_namespace)
  end

  def update_phpipam_rewr_msisdn(old_msisdn, new_msisdn)

    dst_num_exists = database_class.check_if_msisdn_exists(new_msisdn, "ipaddresses")
    if dst_num_exists == 0
      database_class.update_database_rewrite_msisdn(old_msisdn, new_msisdn)
      "updated"
    else
      "failed"
    end
  end

  def final_change_msisdn(old_msisdn, new_msisdn)
    dst_num_exists = database_class.check_if_msisdn_exists(new_msisdn, "ipaddresses")
    if dst_num_exists == 0
      database_class.update_database_rewrite_msisdn(old_msisdn, new_msisdn)
      cps_class.change_attr_cps(old_msisdn, new_msisdn)
      "updated"
    else
      "failed"
    end
  end
  include Phpipam
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
imperituroard-0.1.5 lib/imperituroard.rb