Class: Hbci::Dialog
- Inherits:
-
Object
- Object
- Hbci::Dialog
- Defined in:
- lib/hbci/dialog.rb
Instance Attribute Summary collapse
-
#connector ⇒ Object
readonly
Returns the value of attribute connector.
-
#hbci_version ⇒ Object
readonly
Returns the value of attribute hbci_version.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#system_id ⇒ Object
readonly
Returns the value of attribute system_id.
-
#tan_mechanism ⇒ Object
readonly
Returns the value of attribute tan_mechanism.
Class Method Summary collapse
Instance Method Summary collapse
- #credentials ⇒ Object
- #finish ⇒ Object
-
#initialize(connector, system_id: 0) ⇒ Dialog
constructor
A new instance of Dialog.
- #initiate ⇒ Object
- #initiated? ⇒ Boolean
Constructor Details
#initialize(connector, system_id: 0) ⇒ Dialog
Returns a new instance of Dialog.
19 20 21 22 23 24 25 26 27 |
# File 'lib/hbci/dialog.rb', line 19 def initialize(connector, system_id: 0) @connector = connector @initiated = false @hbci_version = '3.0' @system_id = system_id @tan_mechanism = nil @id = 0 @response = nil end |
Instance Attribute Details
#connector ⇒ Object (readonly)
Returns the value of attribute connector.
10 11 12 |
# File 'lib/hbci/dialog.rb', line 10 def connector @connector end |
#hbci_version ⇒ Object (readonly)
Returns the value of attribute hbci_version.
6 7 8 |
# File 'lib/hbci/dialog.rb', line 6 def hbci_version @hbci_version end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/hbci/dialog.rb', line 5 def id @id end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/hbci/dialog.rb', line 9 def response @response end |
#system_id ⇒ Object (readonly)
Returns the value of attribute system_id.
7 8 9 |
# File 'lib/hbci/dialog.rb', line 7 def system_id @system_id end |
#tan_mechanism ⇒ Object (readonly)
Returns the value of attribute tan_mechanism.
8 9 10 |
# File 'lib/hbci/dialog.rb', line 8 def tan_mechanism @tan_mechanism end |
Class Method Details
Instance Method Details
#credentials ⇒ Object
29 30 31 |
# File 'lib/hbci/dialog.rb', line 29 def credentials @connector.credentials end |
#finish ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/hbci/dialog.rb', line 53 def finish = MessageFactory.build(@connector, self) do |hnvsd| hnvsd.add_segment(Segments::HKENDv1.new) end .compile Response.new(@connector.post()) @connector. end |
#initiate ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hbci/dialog.rb', line 37 def initiate = MessageFactory.build(@connector, self) do |hnvsd| hnvsd.add_segment(Segments::HKIDNv2.new) hnvsd.add_segment(Segments::HKVVBv3.new) end .compile @response = Response.new(@connector.post()) raise DialogError.new('Initialization failed', @response.to_s) unless initialization_successful? @id = @response.find('HNHBK').dialog_id @tan_mechanism = @response.find('HNVSD').find('HIRMS').allowed_tan_mechanism @initiated = true end |
#initiated? ⇒ Boolean
33 34 35 |
# File 'lib/hbci/dialog.rb', line 33 def initiated? @initiated end |