class BankPayments::SwedbankExport::FieldDefinition

Defines a field in the the Swedbank SPISU format

@author Michael Litton

Attributes

name[R]
start[R]
stop[R]
type[R]

Public Class Methods

new(name, definition) click to toggle source
# File lib/bank_payments/swedbank_export/field_definition.rb, line 9
def initialize(name, definition)
  @name                = name
  unformatted_def     = definition.split(':')
  @start, @stop, @type = unformatted_def.each_with_index.map do |value,idx|
    idx < 2 ? value.to_i : value
  end
end

Public Instance Methods

length() click to toggle source
# File lib/bank_payments/swedbank_export/field_definition.rb, line 17
def length
  @stop - @start + 1
end