Class: Tornados::HttpClient

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, path, method, params, logger_status: false) ⇒ HttpClient

Returns a new instance of HttpClient.



10
11
12
13
14
15
16
17
# File 'lib/tornados/http_client.rb', line 10

def initialize(url, path, method, params, logger_status: false)
  @url = url
  @path = path
  @method = method
  @params = params
  @connection = prepare_connection
  @logger_status = logger_status
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def connection
  @connection
end

#logger_statusObject (readonly)

Returns the value of attribute logger_status.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def logger_status
  @logger_status
end

#methodObject (readonly)

Returns the value of attribute method.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def method
  @method
end

#paramsObject (readonly)

Returns the value of attribute params.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def path
  @path
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/tornados/http_client.rb', line 8

def url
  @url
end

Class Method Details

.call(*args) ⇒ Object



19
20
21
# File 'lib/tornados/http_client.rb', line 19

def self.call(*args)
  new(*args).send(:execute)
end