tlopo-request 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile +2 -0
- data/README.md +4 -2
- data/lib/tlopo/request/version.rb +1 -1
- data/lib/tlopo/request.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bf4018b2f6585c8f9c86aba4fb1c7c988ca268231aa33a6a91ce3c605da808
|
4
|
+
data.tar.gz: 67892a85d2ae065de79846a1b8ab90dd75e2f8ae3116eb40b0151db2be09cd3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 342128dab10b3aaf80e3521707e848c286cbdac431d00b4114223bb7eb4d322077aa27a92663e4321e41cfe0cb4e43891d9c8a38cedfd85566ebd74b1abd27c9
|
7
|
+
data.tar.gz: 54e06c03b775fb6d66369493e8b07af4c26b7cc4db19673100934db0621fb33fc7f51770583eec499b6746ccbace87b05edd389431d63d8705304d7af7af8205
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,12 +10,14 @@ Installing is a simple `gem install tlopo-request`
|
|
10
10
|
|
11
11
|
Fluent API:
|
12
12
|
```ruby
|
13
|
-
|
14
|
-
|
13
|
+
require 'tlopo/request'
|
14
|
+
puts Tlopo:Request.new.url('https://postman-echo.com/get').run.code
|
15
|
+
# "200"
|
15
16
|
```
|
16
17
|
|
17
18
|
DSL API:
|
18
19
|
```ruby
|
20
|
+
require 'tlopo/request'
|
19
21
|
url = 'https://postman-echo.com/put?foo=bar&bar=foo'
|
20
22
|
payload = { 'foo' => 'bar', 'bar' => 'foo' }
|
21
23
|
headers = { 'Content-Type': 'application/json' }
|
data/lib/tlopo/request.rb
CHANGED
@@ -11,7 +11,7 @@ module Setters
|
|
11
11
|
names.each do |name|
|
12
12
|
define_method(name) do |val|
|
13
13
|
instance_variable_set("@#{name}", val)
|
14
|
-
|
14
|
+
self
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -20,7 +20,7 @@ end
|
|
20
20
|
module Tlopo
|
21
21
|
class Request
|
22
22
|
extend Setters
|
23
|
-
make_setter :url, :headers, :method, :payload
|
23
|
+
make_setter :url, :headers, :method, :payload, :insecure
|
24
24
|
|
25
25
|
def initialize
|
26
26
|
@method = 'get'
|