Class: Useless::Doc::Core::API
- Inherits:
-
Object
- Object
- Useless::Doc::Core::API
- Defined in:
- lib/useless/doc/core/api.rb
Overview
Documentation for an entire API.
Instance Attribute Summary collapse
-
#description ⇒ String
A description of the API.
-
#name ⇒ String
Nameof the API.
-
#resources ⇒ Array<Resource>
The resources included in the API.
-
#timestamp ⇒ Time
The time that this API doc was last updated.
-
#url ⇒ String
A the URL of the API.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(attrs = {}) ⇒ API
Returns a new instance of API.
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] = attrs[:timestamp] @resources = attrs[:resources] || [] end |
Instance Attribute Details
#description ⇒ String
Returns 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] = attrs[:timestamp] @resources = attrs[:resources] || [] end end |
#name ⇒ String
Returns 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] = attrs[:timestamp] @resources = attrs[:resources] || [] end end |
#resources ⇒ Array<Resource>
Returns 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] = attrs[:timestamp] @resources = attrs[:resources] || [] end end |
#timestamp ⇒ Time
Returns 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] = attrs[:timestamp] @resources = attrs[:resources] || [] end end |
#url ⇒ String
Returns 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] = attrs[:timestamp] @resources = attrs[:resources] || [] end end |