Class: Apiwork::API::Info::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/apiwork/api/info/server.rb

Overview

Server definition block.

Used within the ‘server` block in Apiwork::API::Info.

Instance Method Summary collapse

Constructor Details

#initializeServer

Returns a new instance of Server.



11
12
13
14
# File 'lib/apiwork/api/info/server.rb', line 11

def initialize
  @description = nil
  @url = nil
end

Instance Method Details

#description(value = nil) ⇒ String?

The server description.

Examples:

description 'Production'
server.description # => "Production"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The description.

Returns:

  • (String, nil)


42
43
44
45
46
# File 'lib/apiwork/api/info/server.rb', line 42

def description(value = nil)
  return @description if value.nil?

  @description = value
end

#url(value = nil) ⇒ String?

The server URL.

Examples:

url 'https://api.example.com'
server.url # => "https://api.example.com"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The URL.

Returns:

  • (String, nil)


26
27
28
29
30
# File 'lib/apiwork/api/info/server.rb', line 26

def url(value = nil)
  return @url if value.nil?

  @url = value
end