Class: Useless::Doc::Core::API

Inherits:
Object
  • Object
show all
Defined in:
lib/useless/doc/core/api.rb

Overview

Documentation for an entire API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ API

Returns a new instance of API.

Parameters:

  • attrs (Hash) (defaults to: {})

    corresponds to the class’s instance attributes.



25
26
27
28
29
30
# File 'lib/useless/doc/core/api.rb', line 25

def initialize(attrs = {})
  @url = attrs[:url]
  @description = attrs[:description]
  @timestamp = attrs[:timestamp]
  @resources = attrs[:resources]
end

Instance Attribute Details

#descriptionString

Returns a description of the API.

Returns:

  • (String)

    a description of the API.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/useless/doc/core/api.rb', line 19

class API

  attr_accessor :url, :description, :timestamp, :resources

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @url = attrs[:url]
    @description = attrs[:description]
    @timestamp = attrs[:timestamp]
    @resources = attrs[:resources]
  end
end

#resourcesArray<Resource>

Returns the resources included in the API.

Returns:

  • (Array<Resource>)

    the resources included in the API.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/useless/doc/core/api.rb', line 19

class API

  attr_accessor :url, :description, :timestamp, :resources

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @url = attrs[:url]
    @description = attrs[:description]
    @timestamp = attrs[:timestamp]
    @resources = attrs[:resources]
  end
end

#timestampTime

Returns the time that this API doc was last updated.

Returns:

  • (Time)

    the time that this API doc was last updated.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/useless/doc/core/api.rb', line 19

class API

  attr_accessor :url, :description, :timestamp, :resources

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @url = attrs[:url]
    @description = attrs[:description]
    @timestamp = attrs[:timestamp]
    @resources = attrs[:resources]
  end
end

#urlString

Returns a the URL of the API.

Returns:

  • (String)

    a the URL of the API.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/useless/doc/core/api.rb', line 19

class API

  attr_accessor :url, :description, :timestamp, :resources

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @url = attrs[:url]
    @description = attrs[:description]
    @timestamp = attrs[:timestamp]
    @resources = attrs[:resources]
  end
end