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.
14 15 16 17 |
# File 'lib/hbci/connector.rb', line 14 def initialize(credentials) self.credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/hbci/connector.rb', line 6 def credentials @credentials end |
#message_number ⇒ Object
Returns the value of attribute message_number.
5 6 7 |
# File 'lib/hbci/connector.rb', line 5 def end |
Class Method Details
.open(credentials) {|connector| ... } ⇒ Object
8 9 10 11 12 |
# File 'lib/hbci/connector.rb', line 8 def self.open(credentials) connector = new(credentials) yield connector connector. end |
Instance Method Details
#post(request_message) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/hbci/connector.rb', line 30 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
26 27 28 |
# File 'lib/hbci/connector.rb', line 26 def = 1 end |