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.



28
29
30
31
32
33
34
# File 'lib/useless/doc/core/api.rb', line 28

def initialize(attrs = {})
  @name = attrs[:name]
  @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.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/useless/doc/core/api.rb', line 22

class API

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

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

#nameString

Returns nameof the API.

Returns:

  • (String)

    nameof the API.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/useless/doc/core/api.rb', line 22

class API

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

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @name = attrs[:name]
    @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.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/useless/doc/core/api.rb', line 22

class API

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

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @name = attrs[:name]
    @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.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/useless/doc/core/api.rb', line 22

class API

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

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @name = attrs[:name]
    @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.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/useless/doc/core/api.rb', line 22

class API

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

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