Method: Code::Object::Http.call

Defined in:
lib/code/object/http.rb

.call(**args) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/code/object/http.rb', line 84

def self.call(**args)
  code_operator = args.fetch(:operator, nil).to_code
  code_arguments = args.fetch(:arguments, []).to_code

  case code_operator.to_s
  when "get"
    sig(args) { SIG }
    code_get(*code_arguments.raw)
  when "head"
    sig(args) { SIG }
    code_head(*code_arguments.raw)
  when "post"
    sig(args) { SIG }
    code_post(*code_arguments.raw)
  when "put"
    sig(args) { SIG }
    code_put(*code_arguments.raw)
  when "delete"
    sig(args) { SIG }
    code_delete(*code_arguments.raw)
  when "connect"
    sig(args) { SIG }
    code_connect(*code_arguments.raw)
  when "options"
    sig(args) { SIG }
    code_options(*code_arguments.raw)
  when "trace"
    sig(args) { SIG }
    code_trace(*code_arguments.raw)
  when "patch"
    sig(args) { SIG }
    code_patch(*code_arguments.raw)
  when "fetch"
    sig(args) { [String] + SIG }
    code_fetch(*code_arguments.raw)
  else
    super
  end
end