Sha256: 473f3dc11b4f67144c27fe87ea87f81326f7afbfd778b2b99c800abcd8d14576

Contents?: true

Size: 498 Bytes

Versions: 4

Compression:

Stored size: 498 Bytes

Contents

module Approvals
  module Verifiers
    class JsonVerifier
      def initialize(received_path, approved_path)
        self.received_path = received_path
        self.approved_path = approved_path
      end

      def verify
        approved == received
      end

      private

      attr_accessor :approved_path, :received_path

      def approved
        JSON.parse(File.read(approved_path))
      end

      def received
        JSON.parse(File.read(received_path))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
approvals-0.1.7 lib/approvals/verifiers/json_verifier.rb
approvals-0.0.26 lib/approvals/verifiers/json_verifier.rb
approvals-0.0.25 lib/approvals/verifiers/json_verifier.rb
approvals-0.0.24 lib/approvals/verifiers/json_verifier.rb