Sha256: e050d5e8baa8ac379b99312f49236bad0e34f6fb35bd49ac68c546e745e6b818

Contents?: true

Size: 524 Bytes

Versions: 13

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module ShotgunApiRuby
  class Preferences
    def initialize(connection)
      @connection = connection.dup
      @connection.url_prefix = "#{@connection.url_prefix}/preferences"
    end

    attr_reader :connection

    def all
      resp = @connection.get
      resp_body = JSON.parse(resp.body)

      if resp.status >= 300
        raise "Error while getting server preferences: #{resp_body['errors']}"
      end

      data = resp_body["data"]
      OpenStruct.new(data)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shotgun_api_ruby-0.0.8.4 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.8.3 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.8.2 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.8 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.7 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.5.3 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.5.2 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.5.1 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.5 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.4.1 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.4 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.3 lib/shotgun_api_ruby/preferences.rb
shotgun_api_ruby-0.0.2 lib/shotgun_api_ruby/preferences.rb