Sha256: 20a870a1ad1b1bc790ca6351e9b0882a0fdc8b8057a52181ab191a091d4fc916

Contents?: true

Size: 320 Bytes

Versions: 15

Compression:

Stored size: 320 Bytes

Contents

# frozen_string_literal: true

class Transaction
  attr_reader :value, :type

  def initialize(value:, type:)
    @value = value
    @type = type
  end

  def positive?
    type == 'income'
  end

  def ==(other)
    return false unless other.class == self.class
    other.value == value && other.type == type
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
arstotzka-1.4.2 spec/support/models/transaction.rb
arstotzka-1.4.1 spec/support/models/transaction.rb
arstotzka-1.4.0 spec/support/models/transaction.rb
arstotzka-1.3.2 spec/support/models/transaction.rb
arstotzka-1.3.1 spec/support/models/transaction.rb
arstotzka-1.3.0 spec/support/models/transaction.rb
arstotzka-1.2.4 spec/support/models/transaction.rb
arstotzka-1.2.3 spec/support/models/transaction.rb
arstotzka-1.2.2 spec/support/models/transaction.rb
arstotzka-1.2.1 spec/support/models/transaction.rb
arstotzka-1.2.0 spec/support/models/transaction.rb
arstotzka-1.1.0 spec/support/models/transaction.rb
arstotzka-1.0.4 spec/support/models/transaction.rb
arstotzka-1.0.3 spec/support/models/transaction.rb
arstotzka-1.0.2 spec/support/models/transaction.rb