Class: Hbci::Connector
- Inherits:
-
Object
- Object
- Hbci::Connector
- Defined in:
- lib/hbci/connector.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#message_number ⇒ Object
Returns the value of attribute message_number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Connector
constructor
A new instance of Connector.
- #post(request_message) ⇒ Object
- #reset_message_number ⇒ Object
Constructor Details
#initialize(credentials) ⇒ Connector
Returns a new instance of Connector.
12 13 14 15 |
# File 'lib/hbci/connector.rb', line 12 def initialize(credentials) self.credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
4 5 6 |
# File 'lib/hbci/connector.rb', line 4 def credentials @credentials end |
#message_number ⇒ Object
Returns the value of attribute message_number.
3 4 5 |
# File 'lib/hbci/connector.rb', line 3 def end |
Class Method Details
.open(credentials) {|connector| ... } ⇒ Object
6 7 8 9 10 |
# File 'lib/hbci/connector.rb', line 6 def self.open(credentials) connector = new(credentials) yield connector connector. end |
Instance Method Details
#post(request_message) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/hbci/connector.rb', line 27 def post() req = HTTParty.post(@credentials.url, body: .to_base64) += 1 raise "Error in https communication with bank: #{req.response.inspect}" unless req.success? Base64.decode64(req.response.body) end |
#reset_message_number ⇒ Object
23 24 25 |
# File 'lib/hbci/connector.rb', line 23 def = 1 end |