netologiest 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab1fb2642d66268d3db3645c476ac5c31edc2394
4
- data.tar.gz: '0289f3f6d664b1e66395703fac33ecf26db6b068'
3
+ metadata.gz: 9880e1f8101a1fe1e1d53408bb5679871a561c69
4
+ data.tar.gz: e6c8d1f4b74d93e113f885b10fb5ad8d7e3919a2
5
5
  SHA512:
6
- metadata.gz: 1bf045b926f9a041bb79e8cd002e3e969a0a683b162ac56aa1fe7241518defeecfdffb8061ce170e00ff9a9021f4aaecd508d86e8c279599c84bb6e6a82d4529
7
- data.tar.gz: e26b2deabd30815a72346f03de4a6a4b7b34fd66b7adf7d28c3a7a5eb72b3a53290aef4b0267a110b5aae4982d0251fc985d221aeb0acb2536bacc4441c9795b
6
+ metadata.gz: 2697d8c8c2e0e5ee4719f019c02b305c515e194dd702b8c459116dfdfb4e49d683c8543997a5c29a3503f8c30f727d9b01f5f3693a9c6b6edd6a16b363fa2968
7
+ data.tar.gz: ef01966b368ecea3c9012a81a07510e7148442d5c5dbc0da960ac819b869f63ea48745b2aa119d9bb8e571af443b2c552620c2b3933636fe3b5ed0f44cd8147c
@@ -1,32 +1,34 @@
1
- class HttpClient
2
- class << self
3
- def get(url, params: {})
4
- uri = URI(url)
5
- uri.query = URI.encode_www_form(params)
6
- response = Response.new(Net::HTTP.get_response(uri))
7
- if block_given?
8
- yield response
9
- else
10
- response
1
+ module Netologiest
2
+ class HttpClient
3
+ class << self
4
+ def get(url, params: {})
5
+ uri = URI(url)
6
+ uri.query = URI.encode_www_form(params)
7
+ response = Response.new(Net::HTTP.get_response(uri))
8
+ if block_given?
9
+ yield response
10
+ else
11
+ response
12
+ end
11
13
  end
12
14
  end
13
- end
14
15
 
15
- class Response
16
- attr_reader :body, :code
16
+ class Response
17
+ attr_reader :body, :code
17
18
 
18
- def success?
19
- response.is_a?(Net::HTTPSuccess)
20
- end
19
+ def success?
20
+ response.is_a?(Net::HTTPSuccess)
21
+ end
21
22
 
22
- private
23
+ private
23
24
 
24
- attr_reader :response
25
+ attr_reader :response
25
26
 
26
- def initialize(response)
27
- @response = response
28
- @body = response.body
29
- @code = response.code.to_i
27
+ def initialize(response)
28
+ @response = response
29
+ @body = response.body
30
+ @code = response.code.to_i
31
+ end
30
32
  end
31
33
  end
32
34
  end
@@ -1,4 +1,4 @@
1
1
  # :nodoc:
2
2
  module Netologiest
3
- VERSION = "0.0.3".freeze
3
+ VERSION = "0.0.4".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netologiest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Dem
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler