Class: HelperModule::SimpleRequestHelper

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

Overview

TODO: add SimpleHttpsHelper to support https requests

Direct Known Subclasses

SimpleHttpHelper, SimpleHttpsHelper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, path) ⇒ SimpleRequestHelper

Returns a new instance of SimpleRequestHelper.



12
13
14
# File 'lib/helpers/simple_http_helper.rb', line 12

def initialize(host, port, path)
  @host, @port, @path = host, port, path
end

Instance Attribute Details

#_debugObject

Returns the value of attribute _debug.



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

def _debug
  @_debug
end

#hostObject (readonly)

Returns the value of attribute host.



9
10
11
# File 'lib/helpers/simple_http_helper.rb', line 9

def host
  @host
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/helpers/simple_http_helper.rb', line 9

def path
  @path
end

#portObject (readonly)

Returns the value of attribute port.



9
10
11
# File 'lib/helpers/simple_http_helper.rb', line 9

def port
  @port
end

Instance Method Details

#_create_request_sender(host, port) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/helpers/simple_http_helper.rb', line 20

def _create_request_sender(host, port)
  raise NotImplementedError
end

#_request_prefixObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/helpers/simple_http_helper.rb', line 16

def _request_prefix
  raise NotImplementedError
end

#delete(*args, &block) ⇒ Object



63
64
65
# File 'lib/helpers/simple_http_helper.rb', line 63

def delete(*args, &block)
  return _send_request(DeleteContent, *args, &block)
end

#get(*args, &block) ⇒ Object



55
56
57
# File 'lib/helpers/simple_http_helper.rb', line 55

def get(*args, &block)
  return _send_request(GetContent, *args, &block)
end

#loginsight_get(*args, &block) ⇒ Object



67
68
69
# File 'lib/helpers/simple_http_helper.rb', line 67

def loginsight_get(*args, &block)
  return _send_request(LoginsightGetContent, *args, &block)
end

#patch(*args, &block) ⇒ Object



59
60
61
# File 'lib/helpers/simple_http_helper.rb', line 59

def patch(*args, &block)
  return _send_request(PatchContent, *args, &block)
end

#post(*args, &block) ⇒ Object



51
52
53
# File 'lib/helpers/simple_http_helper.rb', line 51

def post(*args, &block)
  return _send_request(PostContent, *args, &block)
end