Sha256: 0c9828424afc8b72af2ed2d2c1727bb359a93535bf676bd4d4eef385298db4c4

Contents?: true

Size: 998 Bytes

Versions: 16

Compression:

Stored size: 998 Bytes

Contents

# frozen_string_literal: true
require 'ofx-parser'

module EacRailsUtils
  module Patches
    module OfxParser
      module OfxParser
        def self.included(base)
          base.class_eval do
            class << self
              prepend ClassMethods
            end
          end
        end

        module ClassMethods
          def build_transaction(t)
            r = super
            r.currate = (t / 'CURRENCY/CURRATE').inner_text
            r
          end
        end
      end

      module Transaction
        attr_accessor :currate, :cursym
      end
    end
  end
end

unless ::OfxParser::OfxParser.included_modules.include?(
  ::EacRailsUtils::Patches::OfxParser::OfxParser
)
  ::OfxParser::OfxParser.send(:include, ::EacRailsUtils::Patches::OfxParser::OfxParser)
end

unless ::OfxParser::Transaction.included_modules.include?(
  ::EacRailsUtils::Patches::OfxParser::Transaction
)
  ::OfxParser::Transaction.send(:include, ::EacRailsUtils::Patches::OfxParser::Transaction)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eac_rails_utils-0.8.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.7.1 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.7.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.6.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.5.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.4.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.3.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.2.2 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.2.1 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.2.0 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.15 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.14 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.13 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.12 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.11 lib/eac_rails_utils/patches/ofx_parser.rb
eac_rails_utils-0.1.10 lib/eac_rails_utils/patches/ofx_parser.rb