lib/locklizard/customer_commands.rb
# Accepts a response object and returns an array of customer's locklizard ids

Accepts a response object and returns an array of customer's locklizard ids
Accepts a response object and returns an array of customer ' s locklizard ids
def list_customer_publications(custid = nil, email = nil)
      raise ArgumentError.new('Customer Id and email are nil.') if custid.nil? && email.nil?
      suburl = "&action=list_customer" 
      if !custid.nil? && email.nil?
        suburl << "&custid=" + custid.to_s
      elsif custid.nil? && !email.nil? 
        suburl << "&email=" + email
      elsif !custid.nil? && !email.nil?
        suburl << "&custid=" + custid.to_s + "&email=" + email
      end
      http_result = call_target_url(suburl) 
      if success?(http_result)
        publications = http_result.to_s.split("\n")[1].split(" ")[-2].gsub('"', '').split(",") 
      else
       raise ArgumentError.new('Parsing Error in list_customer_publications') 
      end
      return publications.uniq if publications.is_a? Array
    end
def list_customer_publications ( custid = nil , email = nil ) raise ArgumentError . new ( 'Customer Id and email are nil.' ) if custid . nil? && email . nil? suburl = "&action=list_customer" if ! custid . nil? && email . nil? suburl << "&custid=" + custid . to_s elsif custid . nil? && ! email . nil? suburl << "&email=" + email elsif ! custid . nil? && ! email . nil? suburl << "&custid=" + custid . to_s + "&email=" + email end http_result = call_target_url ( suburl ) if success? ( http_result ) publications = http_result . to_s . split ( "\n" ) [ 1 ] . split ( " " ) [ - 2 ] . gsub ( '"' , '' ) . split ( "," ) else raise ArgumentError . new ( 'Parsing Error in list_customer_publications' ) end return publications . uniq if publications . is_a? Array end
Accepts a response object and returns an array of customer's locklizard ids
Accepts a response object and returns an array of customer ' s locklizard ids
# call private method
 # return an array

custid
email