Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/dpr.rb

Instance Method Summary collapse

Instance Method Details

#http_delete(params: {}, headers: {}) ⇒ Object



14
15
16
# File 'lib/dpr.rb', line 14

def http_delete params: {}, headers: {}
  to_resp 'delete', headers, params
end

#http_get(params: {}, headers: {}) ⇒ Object



6
7
8
# File 'lib/dpr.rb', line 6

def http_get params: {}, headers: {}
  to_resp 'get', headers, params
end

#http_patch(params: {}, headers: {}) ⇒ Object



22
23
24
# File 'lib/dpr.rb', line 22

def http_patch params: {}, headers: {}
  to_resp 'patch', headers, params
end

#http_post(params: {}, headers: {}) ⇒ Object



10
11
12
# File 'lib/dpr.rb', line 10

def http_post params: {}, headers: {}
  to_resp 'post', headers, params
end

#http_put(params: {}, headers: {}) ⇒ Object



18
19
20
# File 'lib/dpr.rb', line 18

def http_put params: {}, headers: {}
  to_resp 'put', headers, params
end

#valid_url?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'lib/dpr.rb', line 26

def valid_url?
  uri = URI.parse self
  uri.kind_of? URI::HTTP
rescue URI::InvalidURIError
  false
end