So I am fairly new to Ruby and this may very well be answered elsewhere but I have searched high and low with nothing to show.
I am defining a module for a RESTful API framework and mostly things have gone well apart from trying to get a string from a .txt file into the actual API end point (before parameters)
MY code is this:
require 'rest-client'
module Delete
def delete
file = File.open("ST.txt", "r")
sT = file.read,
file = File.open("cR.txt","r")
cR = file.read
begin
return RestClient.post({'https://testing.ixaris.com/paymentpartner/virtualcards/{cR}/delete'},
{ },
{:A => sT,})
rescue => e
return e.response
end
end
end
The the first "ST.txt" into the "A parameter" works fine but I can't seem to get the "cR" string into the "{cR}" part of the end point.
Any help would be hugely appreciated!