Sha256: cd90aaae79f8b61d845f449caefbc92491f45dc825f90a8c610ce2ff399c52c2

Contents?: true

Size: 774 Bytes

Versions: 117

Compression:

Stored size: 774 Bytes

Contents

require 'travis/client/weak_entity'
require 'json'

module Travis
  module Client
    class Settings < WeakEntity
      attr_accessor :repository
      # @!parse attr_reader :builds_only_with_travis_yml, :build_pushes, :build_pull_requests, :maximum_number_of_builds
      attributes :builds_only_with_travis_yml, :build_pushes, :build_pull_requests, :maximum_number_of_builds
      one :settings
      many :settings

      def save
        raise "repository unknown" unless repository
        result = session.patch("/repos/#{repository.id}/settings", JSON.dump("settings" => attributes))
        attributes.replace(result['settings'].attributes)
        self
      end

      def inspect_info
        repository ? repository.slug : repository
      end
    end
  end
end

Version data entries

117 entries across 117 versions & 2 rubygems

Version Path
travis-1.7.2.travis.635.5 lib/travis/client/settings.rb
travis-1.7.2.travis.634.5 lib/travis/client/settings.rb
travis-1.7.2.travis.633.5 lib/travis/client/settings.rb
travis-1.7.2.travis.632.5 lib/travis/client/settings.rb
travis-1.7.2.travis.630.5 lib/travis/client/settings.rb
travis-1.7.2.travis.627.5 lib/travis/client/settings.rb
travis-1.7.2.travis.626.5 lib/travis/client/settings.rb
travis-1.7.2.travis.625.5 lib/travis/client/settings.rb
travis-1.7.2.travis.623.5 lib/travis/client/settings.rb
travis-1.7.2.travis.621.5 lib/travis/client/settings.rb
travis-1.7.1 lib/travis/client/settings.rb
travis-1.7.1.travis.613.5 lib/travis/client/settings.rb
travis-1.7.0 lib/travis/client/settings.rb
travis-1.6.18.travis.612.5 lib/travis/client/settings.rb
travis-1.6.18.travis.611.5 lib/travis/client/settings.rb
travis-1.6.18.travis.610.5 lib/travis/client/settings.rb
travis-1.6.18.travis.609.5 lib/travis/client/settings.rb
travis-1.6.18.travis.608.5 lib/travis/client/settings.rb
travis-1.6.18.travis.607.5 lib/travis/client/settings.rb
travis-1.6.18.travis.606.5 lib/travis/client/settings.rb