Class: TLAW::APIPath
- Inherits:
-
Object
- Object
- TLAW::APIPath
- Extended by:
- Forwardable
- Defined in:
- lib/tlaw/api_path.rb
Overview
Base class for all API pathes: entire API, namespaces and endpoints. Allows to define params and post-processors on any level.
Class Method Summary collapse
-
.describe(definition = nil) ⇒ Util::Description
Redefined on descendants, it just allows you to do
api.namespace.describe
orapi.namespace1.namespace2.endpoints[:my_endpoint].describe
and have reasonable useful description printed. - .param_set ⇒ ParamSet
Instance Method Summary collapse
-
#initialize(**parent_params) ⇒ APIPath
constructor
A new instance of APIPath.
Constructor Details
#initialize(**parent_params) ⇒ APIPath
Returns a new instance of APIPath.
127 128 129 |
# File 'lib/tlaw/api_path.rb', line 127 def initialize(**parent_params) @parent_params = parent_params end |
Class Method Details
.describe(definition = nil) ⇒ Util::Description
Redefined on descendants, it just allows you to do api.namespace.describe
or api.namespace1.namespace2.endpoints[:my_endpoint].describe
and have reasonable useful description printed.
95 96 97 98 99 100 101 |
# File 'lib/tlaw/api_path.rb', line 95 def describe(definition = nil) Util::Description.new( ".#{definition || to_method_definition}" + (description ? "\n" + description.indent(' ') + "\n" : '') + (param_set.empty? ? '' : "\n" + param_set.describe.indent(' ')) ) end |