Class: Rack::ServiceApiVersioning::EncodedApiVersionData
- Inherits:
-
Object
- Object
- Rack::ServiceApiVersioning::EncodedApiVersionData
- Extended by:
- Forwardable
- Defined in:
- lib/rack/service_api_versioning/encoded_api_version_data.rb,
lib/rack/service_api_versioning/encoded_api_version_data/input_data.rb,
lib/rack/service_api_versioning/encoded_api_version_data/return_data.rb
Overview
Builds an API Version data hash and encodes as JSON, for injection into a Rack environment, normally with the key “COMPONENT_API_VERSION_DATA”.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call(api_version:, data:) ⇒ Object
18 19 20 |
# File 'lib/rack/service_api_versioning/encoded_api_version_data.rb', line 18 def self.call(api_version:, data:) new(api_version, data).call end |
Instance Method Details
#call ⇒ Object
22 23 24 |
# File 'lib/rack/service_api_versioning/encoded_api_version_data.rb', line 22 def call JSON.dump(version_data.to_hash) end |