Sha256: 72763868e2180a8bb7f8c015c15027d6a3c24a517307adf20514b6f0b1ada698

Contents?: true

Size: 381 Bytes

Versions: 29

Compression:

Stored size: 381 Bytes

Contents

module Pacioli
  class PostingRuleValidator
    attr_accessor :posting_rule

    def self.for(posting_rule)
      validator = new
      validator.posting_rule = posting_rule
      validator
    end

    def execute
      raise Pacioli::PostingRuleNotBalancedException, "The aggregate balance of debits and credits must be equal" unless self.posting_rule.balanced?
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
pacioli-0.0.29 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.28 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.27 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.26 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.25 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.24 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.23 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.22 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.21 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.20 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.19 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.18 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.17 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.16 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.15 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.14 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.13 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.12 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.11 lib/pacioli/validations/posting_rule_validator.rb
pacioli-0.0.10 lib/pacioli/validations/posting_rule_validator.rb