Class: Braspag::Poster
- Inherits:
-
Object
- Object
- Braspag::Poster
- Defined in:
- lib/cbraspag/core/poster.rb
Instance Method Summary collapse
- #do_post(method, data) ⇒ Object
-
#initialize(connection, url) ⇒ Poster
constructor
A new instance of Poster.
Constructor Details
#initialize(connection, url) ⇒ Poster
Returns a new instance of Poster.
3 4 5 6 |
# File 'lib/cbraspag/core/poster.rb', line 3 def initialize(connection, url) @connection = connection @request = ::HTTPI::Request.new(url) end |
Instance Method Details
#do_post(method, data) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/cbraspag/core/poster.rb', line 8 def do_post(method, data) @request.body = data @request.proxy = @connection.proxy_address if @connection.proxy_address with_logger(method) do ::HTTPI.post @request end end |