Class: Request
- Inherits:
-
Object
- Object
- Request
- Defined in:
- lib/minered/request.rb
Instance Method Summary collapse
-
#initialize(host, endpoint, key) ⇒ Request
constructor
A new instance of Request.
- #post(options) ⇒ Object
Constructor Details
#initialize(host, endpoint, key) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 |
# File 'lib/minered/request.rb', line 5 def initialize(host, endpoint, key) @http = Net::HTTP.new(host) @endpoint = endpoint @key = key end |
Instance Method Details
#post(options) ⇒ Object
11 12 13 14 15 |
# File 'lib/minered/request.rb', line 11 def post() request = Net::HTTP::Post.new(@endpoint) request.set_form_data(.merge!({'key' => @key})) response = @http.request(request) end |