Class: HelperModule::SimpleRequestHelper

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

Direct Known Subclasses

SimpleHttpHelper, SimpleHttpsHelper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, path) ⇒ 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)


26
27
28
# File 'lib/helpers/simple_http_helper.rb', line 26

def _create_request_sender(host, port)
  raise NotImplementedError
end

#_request_prefixObject

Raises:

  • (NotImplementedError)


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

def _request_prefix
  raise NotImplementedError
end

#delete(*args, &block) ⇒ Object



71
72
73
# File 'lib/helpers/simple_http_helper.rb', line 71

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

#get(*args, &block) ⇒ Object



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

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

#loginsight_get(*args, &block) ⇒ Object



75
76
77
# File 'lib/helpers/simple_http_helper.rb', line 75

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

#patch(*args, &block) ⇒ Object



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

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

#post(*args, &block) ⇒ Object



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

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

#set_auth(username, password) ⇒ Object



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

def set_auth(username, password)
  @auth = OpenStruct.new
  @auth.username = username
  @auth.password = password
end