Sha256: 0155c11db8fd791157502b41041ec9c3015580df97ea80eeb033cec91ed692ce

Contents?: true

Size: 558 Bytes

Versions: 4

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

module ShotgridApiRuby
  class ServerInfo
    def initialize(connection)
      @connection = connection
    end

    attr_reader :connection

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

      if resp.status >= 300
        raise ShotgridCallError.new(
                response: resp,
                message:
                  "Error while getting server infos: #{resp_body['errors']}",
              )
      end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shotgrid_api_ruby-0.1.3.3 lib/shotgrid_api_ruby/server_info.rb
shotgrid_api_ruby-0.1.3.2 lib/shotgrid_api_ruby/server_info.rb
shotgrid_api_ruby-0.1.3.1 lib/shotgrid_api_ruby/server_info.rb
shotgrid_api_ruby-0.1.3 lib/shotgrid_api_ruby/server_info.rb