Class: Urushiol::Txreq

Inherits:
Object
  • Object
show all
Defined in:
lib/txreq.rb

Instance Method Summary collapse

Constructor Details

#initializeTxreq

Returns a new instance of Txreq.



4
5
6
# File 'lib/txreq.rb', line 4

def initialize
  @req = "\ntxreq"
end

Instance Method Details

#get_sourceObject



24
25
26
# File 'lib/txreq.rb', line 24

def get_source
  @req
end

#host(host) ⇒ Object



16
17
18
# File 'lib/txreq.rb', line 16

def host(host)
  @req << " -hdr \"Host: #{host.strip}\""
end

#protocol(proto) ⇒ Object



12
13
14
# File 'lib/txreq.rb', line 12

def protocol(proto)
  @req << " -proto #{proto.strip}"
end

#request(type) ⇒ Object



20
21
22
# File 'lib/txreq.rb', line 20

def request(type)
  @req << " -req #{type.strip.upcase}"
end

#url(url) ⇒ Object



8
9
10
# File 'lib/txreq.rb', line 8

def url(url)
  @req << " -url #{url.strip}"
end