Class: Hbci::Response
- Inherits:
-
Object
- Object
- Hbci::Response
- Defined in:
- lib/hbci/response.rb
Instance Method Summary collapse
- #find(segment_type) ⇒ Object
- #find_all(segment_type) ⇒ Object
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#find(segment_type) ⇒ Object
11 12 13 14 15 |
# File 'lib/hbci/response.rb', line 11 def find(segment_type) segments = find_all(segment_type) warn "more then one #{segment_type} segment available" if segments.size > 1 segments.first end |
#find_all(segment_type) ⇒ Object
17 18 19 |
# File 'lib/hbci/response.rb', line 17 def find_all(segment_type) @raw_segments.select { |sd| sd[0][0] == segment_type }.map{ |sd| Hbci::SegmentFactory.build(sd) } end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/hbci/response.rb', line 21 def to_s @raw_response end |