Class: Fiscalizer::RequestSender
- Inherits:
-
Object
- Object
- Fiscalizer::RequestSender
- Includes:
- Constants
- Defined in:
- lib/fiscalizer/services/request_sender.rb
Constant Summary
Constants included from Constants
Constants::DEMO_CERT_ISSUER, Constants::DEMO_URL, Constants::PROD_CERT_ISSUER, Constants::PROD_URL, Constants::SCHEMA_LOCATION, Constants::TNS, Constants::XSI
Instance Attribute Summary collapse
-
#app_cert ⇒ Object
readonly
Returns the value of attribute app_cert.
-
#ca_cert_path ⇒ Object
readonly
Returns the value of attribute ca_cert_path.
-
#demo ⇒ Object
readonly
Returns the value of attribute demo.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(app_cert, password, timeout, demo, ca_cert_path) ⇒ RequestSender
constructor
A new instance of RequestSender.
- #send(message) ⇒ Object
Constructor Details
#initialize(app_cert, password, timeout, demo, ca_cert_path) ⇒ RequestSender
Returns a new instance of RequestSender.
5 6 7 8 9 10 11 12 13 |
# File 'lib/fiscalizer/services/request_sender.rb', line 5 def initialize(app_cert, password, timeout, demo, ca_cert_path) @app_cert = app_cert @password = password @timeout = timeout @demo = demo @ca_cert_path = ca_cert_path prepare_net_http end |
Instance Attribute Details
#app_cert ⇒ Object (readonly)
Returns the value of attribute app_cert.
15 16 17 |
# File 'lib/fiscalizer/services/request_sender.rb', line 15 def app_cert @app_cert end |
#ca_cert_path ⇒ Object (readonly)
Returns the value of attribute ca_cert_path.
15 16 17 |
# File 'lib/fiscalizer/services/request_sender.rb', line 15 def ca_cert_path @ca_cert_path end |
#demo ⇒ Object (readonly)
Returns the value of attribute demo.
15 16 17 |
# File 'lib/fiscalizer/services/request_sender.rb', line 15 def demo @demo end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
15 16 17 |
# File 'lib/fiscalizer/services/request_sender.rb', line 15 def password @password end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
15 16 17 |
# File 'lib/fiscalizer/services/request_sender.rb', line 15 def timeout @timeout end |
Instance Method Details
#send(message) ⇒ Object
17 18 19 20 21 |
# File 'lib/fiscalizer/services/request_sender.rb', line 17 def send() request.content_type = 'application/xml' request.body = http.request(request) end |