Skip to content

Instantly share code, notes, and snippets.

View sos4nt's full-sized avatar

Stefan Schüßler sos4nt

View GitHub Profile
class Client
def self.post(&block)
data = DslData.new
Dsl.new(data).instance_eval(&block)
# build request with data from dsl calls
# and execute request
puts "Making a request to #{data.url} with headers #{data.headers}"
response = "response" # this would be your http response
if rand > 0.5 # response.success?