Sha256: ffd379e9beaace7c5abf379aca631f5250d742063fa767b83c4bc9c57440d1e2

Contents?: true

Size: 514 Bytes

Versions: 25

Compression:

Stored size: 514 Bytes

Contents

require 'roar/json'

module PactBroker

  module Api

    module Decorators

      module Timestamps

        include Roar::JSON

        property :optional_updated_at, as: :updatedAt, exec_context: :decorator, writeable: false
        property :createdAt, getter: lambda { |_|  created_at.xmlschema }, writeable: false

        def optional_updated_at
          if represented.updated_at != represented.created_at
            represented.updated_at.xmlschema
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pact_broker-1.8.0 lib/pact_broker/api/decorators/timestamps.rb
pact_broker-1.7.0 lib/pact_broker/api/decorators/timestamps.rb
pact_broker-1.6.0 lib/pact_broker/api/decorators/timestamps.rb
pact_broker-1.5.0 lib/pact_broker/api/decorators/timestamps.rb
pact_broker-1.4.0 lib/pact_broker/api/decorators/timestamps.rb