Module: EacEnvs::Http::Response::Body
- Defined in:
- lib/eac_envs/http/response/body.rb
Instance Method Summary collapse
- #body_data ⇒ Object
- #body_data! ⇒ Object
-
#body_data_or_raise ⇒ Object
deprecated
Deprecated.
Use #body_data! instead.
- #body_str ⇒ String
- #body_str! ⇒ String
-
#body_str_or_raise ⇒ Object
deprecated
Deprecated.
Use #body_str! instead.
- #write_body(path) ⇒ Object
Instance Method Details
#body_data ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/eac_envs/http/response/body.rb', line 9 def body_data r = body_data_method_name.if_present(body_str) do |v| respond_to?(v, true) ? send(v) : body_str end r = response_body_data_proc.call(r) if response_body_data_proc.present? r end |
#body_data! ⇒ Object
19 20 21 22 23 |
# File 'lib/eac_envs/http/response/body.rb', line 19 def body_data! raise_unless_200 body_data end |
#body_data_or_raise ⇒ Object
Deprecated.
Use #body_data! instead.
28 29 30 |
# File 'lib/eac_envs/http/response/body.rb', line 28 def body_data_or_raise body_data! end |
#body_str ⇒ String
33 34 35 |
# File 'lib/eac_envs/http/response/body.rb', line 33 def body_str performed.body end |
#body_str! ⇒ String
39 40 41 42 43 |
# File 'lib/eac_envs/http/response/body.rb', line 39 def body_str! raise_unless_200 body_str end |
#body_str_or_raise ⇒ Object
Deprecated.
Use #body_str! instead.
48 49 50 |
# File 'lib/eac_envs/http/response/body.rb', line 48 def body_str_or_raise body_str! end |
#write_body(path) ⇒ Object
53 54 55 |
# File 'lib/eac_envs/http/response/body.rb', line 53 def write_body(path) ::File.binwrite(path, performed.body) end |