Class: Relax2::Base
Direct Known Subclasses
Class Method Summary collapse
Methods included from DSL
Class Method Details
.call(request) ⇒ Object
16 17 18 |
# File 'lib/relax2/base.rb', line 16 def self.call(request) RequestContext.new(base_url: @base_url, interceptors: @interceptors).call(request) end |
.run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/relax2/base.rb', line 20 def self.run from_pipe = File.pipe?($stdin) from_redirect = !IO.select([$stdin], [], [], 0).nil? body = $stdin.read if from_pipe || from_redirect request = Request.from(args: ARGV, body: body) @interceptors ||= [] @interceptors << Interceptors.print_response if @interceptors.empty? call(request) end |