Class: Restspec::Stores::EndpointStoreDelegator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Restspec::Stores::EndpointStoreDelegator
- Defined in:
- lib/restspec/stores/endpoint_store.rb
Overview
Provides methods for the EndpointStore object.
Instance Method Summary collapse
-
#get(endpoint_name) ⇒ Restspec::Endpoints::Endpoint?
Get is just an alias for Hash#[].
-
#get_by_schema_name_and_role(schema_name, endpoint_name, role) ⇒ Restspec::Endpoints::Endpoint?
Get an endpoint by the schema, name and a role.
-
#store(endpoint) ⇒ Restspec::Endpoints::Endpoint
Stores an endpoint.
Instance Method Details
#get(endpoint_name) ⇒ Restspec::Endpoints::Endpoint?
Get is just an alias for Hash#[]
18 19 20 |
# File 'lib/restspec/stores/endpoint_store.rb', line 18 def get(endpoint_name) self[endpoint_name] end |
#get_by_schema_name_and_role(schema_name, endpoint_name, role) ⇒ Restspec::Endpoints::Endpoint?
Get an endpoint by the schema, name and a role.
32 33 34 35 36 |
# File 'lib/restspec/stores/endpoint_store.rb', line 32 def get_by_schema_name_and_role(schema_name, endpoint_name, role) values.find do |endpoint| endpoint.name == endpoint_name && endpoint.schema_for(role).try(:name) == schema_name end end |
#store(endpoint) ⇒ Restspec::Endpoints::Endpoint
Stores an endpoint. It uses the full_name method of the endpoint to use as the key for the endpoint itself.
12 13 14 |
# File 'lib/restspec/stores/endpoint_store.rb', line 12 def store(endpoint) self[endpoint.full_name] = endpoint end |