Class: VtApi::ApiVersion Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/vt_api/internal/api_version.rb

Overview

This class is abstract.

Base class for API interfaces.

Direct Known Subclasses

Versions::ApiV2

Instance Method Summary collapse

Instance Method Details

#base_urlString

Get API base URL.

Returns:

  • (String)


9
10
11
# File 'lib/vt_api/internal/api_version.rb', line 9

def base_url
	''
end

#endpoint(_method) ⇒ VtApi::Endpoint

Get API method endpoint interface.

Parameters:

  • _method (String)

    API method name to be called.

Returns:



40
41
42
# File 'lib/vt_api/internal/api_version.rb', line 40

def endpoint(_method)
	nil
end

#endpoint?(_method) ⇒ Boolean

Check whether given method is defined in interface.

Parameters:

  • _method (String)

    Method name.

Returns:

  • (Boolean)


48
49
50
# File 'lib/vt_api/internal/api_version.rb', line 48

def endpoint?(_method)
	false
end

#error(_http_code) ⇒ String

Get API HTTP-code description.

Parameters:

  • _http_code (Integer)

Returns:

  • (String)

    Error description.



24
25
26
# File 'lib/vt_api/internal/api_version.rb', line 24

def error(_http_code)
	nil
end

#error?(_http_code) ⇒ Boolean

Check whether API HTTP-code means error.

Parameters:

  • _http_code (Integer)

Returns:

  • (Boolean)

    Error description.



32
33
34
# File 'lib/vt_api/internal/api_version.rb', line 32

def error?(_http_code)
	false
end

#versionString

API interface name/version.

Returns:

  • (String)


16
17
18
# File 'lib/vt_api/internal/api_version.rb', line 16

def version
	nil
end