Sha256: e797b78c6e0b37b7f33473fc7030680fe1fa5ff67f8e67d0632374431dc00019

Contents?: true

Size: 872 Bytes

Versions: 119

Compression:

Stored size: 872 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, :auto_cancel_pushes, :auto_cancel_pull_requests
      attributes :builds_only_with_travis_yml, :build_pushes, :build_pull_requests, :maximum_number_of_builds, :auto_cancel_pushes, :auto_cancel_pull_requests
      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

119 entries across 119 versions & 2 rubygems

Version Path
travis-1.8.12.travis.1101.9 lib/travis/client/settings.rb
travis-1.8.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1098.9 lib/travis/client/settings.rb
travis-1.8.11.travis.1081.9 lib/travis/client/settings.rb
travis-1.8.11.travis.1059.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1058.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1056.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1051.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1048.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1044.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1041.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1040.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1026.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1025.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1024.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1022.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1021.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1020.11 lib/travis/client/settings.rb
travis-1.8.11.travis.1012.9 lib/travis/client/settings.rb
travis-1.8.11.travis.1011.9 lib/travis/client/settings.rb