Class: Useless::Doc::Core::Resource
- Inherits:
-
Object
- Object
- Useless::Doc::Core::Resource
- Defined in:
- lib/useless/doc/core/resource.rb
Overview
Documentation for an API resource.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
A description of the resource.
-
#path ⇒ String
readonly
The path segment of the resource URL.
-
#requests ⇒ Array<Request>
readonly
Requests that could possibly be made against this resource.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(attrs = {}) ⇒ Resource
Returns a new instance of Resource.
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
#description ⇒ String (readonly)
Returns 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 |
#path ⇒ String (readonly)
Returns 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 |
#requests ⇒ Array<Request> (readonly)
Returns requests that could possibly be made against this 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 |