Sha256: 8ecebaf857f13ee50a5a0d66876ab2c192c847421a579fa9e64c056dc4e3ee4b

Contents?: true

Size: 520 Bytes

Versions: 56

Compression:

Stored size: 520 Bytes

Contents

require 'travis/client'

module Travis
  module Client
    class WeakEntity < Entity
      def self.weak?
        true
      end

      def self.id_field
        raise "weak entities do not have id fields"
      end

      def self.id?(object)
        object.nil?
      end

      def self.cast_id(object)
        return object if id? object
        raise "weak entities do not have id fields"
      end

      def missing?(attribute)
        false
      end

      def complete?
        true
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
travis-1.6.4.travis.413.4 lib/travis/client/weak_entity.rb
travis-1.6.4.travis.410.4 lib/travis/client/weak_entity.rb
travis-1.6.4.travis.411.4 lib/travis/client/weak_entity.rb
travis-1.6.4.travis.406.4 lib/travis/client/weak_entity.rb
travis-1.6.4.travis.405.4 lib/travis/client/weak_entity.rb
travis-1.6.4.travis.395.4 lib/travis/client/weak_entity.rb
travis-1.6.3 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.394.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.392.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.390.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.389.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.388.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.387.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.386.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.385.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.384.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.381.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.379.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.377.4 lib/travis/client/weak_entity.rb
travis-1.6.3.travis.376.4 lib/travis/client/weak_entity.rb