Class: Useless::Doc::Core::Resource

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

Overview

Documentation for an API resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Resource

Returns a new instance of Resource.

Parameters:

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

    corresponds to the class’s instance attributes.



24
25
26
27
28
# File 'lib/useless/doc/core/resource.rb', line 24

def initialize(attrs = {})
  @path         = attrs[:path]
  @description  = attrs[:description]
  @requests     = attrs[:requests] || []
end

Instance Attribute Details

#descriptionString (readonly)

Returns a description of the resource.

Returns:

  • (String)

    a description of the resource.



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

class Resource

  attr_reader :path, :description, :requests

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

#pathString (readonly)

Returns the path segment of the resource URL.

Returns:

  • (String)

    the path segment of the resource URL.



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

class Resource

  attr_reader :path, :description, :requests

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

#requestsArray<Request> (readonly)

Returns requests that could possibly be made against this resource.

Returns:

  • (Array<Request>)

    requests that could possibly be made against this resource.

See Also:



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

class Resource

  attr_reader :path, :description, :requests

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