Sha256: 46997e64c9b6a958577a219546eca9b4edde1dea0dcc2e618710fc8a9734c50b

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true
module OFX
  class Document
    class IncludeTransactions < StatementRequest
      def initialize(options = {})
        @tag = :inctran
        @include = options[:include].nil? ? true : false
        super
      end

      def include
        include? ? 'Y' : 'N'
      end

      def dtstart
        date(@start || Date.today - 30)
      end

      def dtend
        date(@end || Date.today)
      end

      protected

      def include?
        @include
      end

      def date(date)
        date.strftime('%Y%m%d%H%M%S')
      end

      def order
        %w{ dtstart dtend include }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ofx_ruby-0.0.15 lib/ofx/document/include_transactions.rb
ofx_ruby-0.0.14 lib/ofx/document/include_transactions.rb
ofx_ruby-0.0.13 lib/ofx/document/include_transactions.rb
ofx_ruby-0.0.12 lib/ofx/document/include_transactions.rb
ofx_ruby-0.0.11 lib/ofx/document/include_transactions.rb