Class: Eco::API::UseCases::BaseCase
- Extended by:
- Common::ClassHelpers
- Defined in:
- lib/eco/api/usecases/base_case.rb
Overview
Core class of UseCases. It basically defines and manages allowed types
Defined Under Namespace
Classes: InvalidType
Class Attribute Summary collapse
-
.types ⇒ Object
readonly
Returns the value of attribute types.
Class Method Summary collapse
Methods included from Common::ClassHelpers
class_resolver, descendants, descendants?, inheritable_attrs, inheritable_class_vars, inherited, instance_variable_name, new_class, resolve_class, to_constant
Class Attribute Details
.types ⇒ Object (readonly)
Returns the value of attribute types.
27 28 29 |
# File 'lib/eco/api/usecases/base_case.rb', line 27 def types @types end |
Class Method Details
.valid_type?(type) ⇒ Boolean
29 30 31 |
# File 'lib/eco/api/usecases/base_case.rb', line 29 def valid_type?(type) types.include?(type) end |
.validate_type(type) ⇒ Object
33 34 35 |
# File 'lib/eco/api/usecases/base_case.rb', line 33 def validate_type(type) raise InvalidType.new(type: type, types: types) unless valid_type?(type) end |