class Hbci::Response

Public Class Methods

new(raw_response) click to toggle source
# File lib/hbci/response.rb, line 5
def initialize(raw_response)
  @raw_response = raw_response
  @raw_segments = Parser.parse(raw_response.force_encoding('iso-8859-1'))
end

Public Instance Methods

find(segment_type) click to toggle source
# File lib/hbci/response.rb, line 10
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) click to toggle source
# File lib/hbci/response.rb, line 16
def find_all(segment_type)
  @raw_segments.select { |sd| sd[0][0] == segment_type }.map { |sd| Hbci::SegmentFactory.build(sd) }
end
to_s() click to toggle source
# File lib/hbci/response.rb, line 20
def to_s
  @raw_response
end