Class: Useless::Doc::Resource
- Inherits:
-
Object
- Object
- Useless::Doc::Resource
- Defined in:
- lib/useless/doc/resource.rb
Overview
Documentation for an API resource.
Instance Attribute Summary collapse
-
#actions ⇒ Array<Action>
readonly
Documentation for the available actions for the resource.
-
#description ⇒ String
readonly
A description of the resource.
-
#path ⇒ String
readonly
The path segment of the resource URL.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(attrs = {}) ⇒ Resource
Returns a new instance of Resource.
22 23 24 25 26 |
# File 'lib/useless/doc/resource.rb', line 22 def initialize(attrs = {}) @path = attrs[:path] @description = attrs[:description] @actions = attrs[:actions] end |
Instance Attribute Details
#actions ⇒ Array<Action> (readonly)
Returns documentation for the available actions for the resource.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/useless/doc/resource.rb', line 16 class Resource attr_reader :path, :description, :actions # @param [Hash] attrs corresponds to the class's instance attributes. # def initialize(attrs = {}) @path = attrs[:path] @description = attrs[:description] @actions = attrs[:actions] end end |
#description ⇒ String (readonly)
Returns a description of the resource.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/useless/doc/resource.rb', line 16 class Resource attr_reader :path, :description, :actions # @param [Hash] attrs corresponds to the class's instance attributes. # def initialize(attrs = {}) @path = attrs[:path] @description = attrs[:description] @actions = attrs[:actions] end end |
#path ⇒ String (readonly)
Returns the path segment of the resource URL.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/useless/doc/resource.rb', line 16 class Resource attr_reader :path, :description, :actions # @param [Hash] attrs corresponds to the class's instance attributes. # def initialize(attrs = {}) @path = attrs[:path] @description = attrs[:description] @actions = attrs[:actions] end end |