Since you said you are learning ruby I would have some pointers.
1. Ruby uses camel-case for class names and underscores for variables and methods. Also try to use two spaces for tabs and use them consistently.
class BPLIB > class BpLib
bpCreateInvoice -> bp_create_invoice
etc.
You can read more about the Ruby style in
this website.
2. You can make this a one liner if you would want to
options = @options.merge(options)
options[:price] = price
options[:orderId]= orderid
options[:posData]= posData
options = @options.merge(options).merge({:price => price, :orderId => orderid, :postDate => posData})
3. I would probably rewrite this bit using has_key? since I find it increases readability.
postOptions.each_with_index do |opt,index|
if options.include(opt[index])
postdata[index] = options[index]
end
end
postOptions.each do |key|
if @options.has_key?(key)
postdata[key] = @options[key]
end
end
4. Is the code actually working? It seems you define postdata after you try to fill it.
Hope these tips help