Class: Spanx::Client
- Inherits:
-
Object
- Object
- Spanx::Client
- Defined in:
- lib/spanx/client.rb,
lib/spanx/client/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Class Method Summary collapse
- .blocked_ips ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .unblock(ip) ⇒ Object
- .url ⇒ Object
- .url=(url) ⇒ Object
Class Method Details
.blocked_ips ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/spanx/client.rb', line 20 def self.blocked_ips response = request "/ips/blocked" do |uri| Net::HTTP::Get.new(uri.request_uri) end JSON.parse(response.body) end |
.configure {|_self| ... } ⇒ Object
16 17 18 |
# File 'lib/spanx/client.rb', line 16 def self.configure yield self end |
.unblock(ip) ⇒ Object
28 29 30 31 32 |
# File 'lib/spanx/client.rb', line 28 def self.unblock(ip) request "/ips/blocked/#{ip}" do |uri| Net::HTTP::Delete.new(uri.request_uri) end end |
.url ⇒ Object
12 13 14 |
# File 'lib/spanx/client.rb', line 12 def self.url @url || "http://localhost:6060" end |
.url=(url) ⇒ Object
8 9 10 |
# File 'lib/spanx/client.rb', line 8 def self.url=(url) @url = url end |