Module: Hanami::Model::Types::ClassMethods
- Defined in:
- lib/hanami/model/types.rb
Overview
Class level interface
Instance Method Summary collapse
-
#Collection(type) ⇒ Object
Define an array of given type.
-
#Entity(type) ⇒ Object
Define an entity of the given type.
Instance Method Details
#Collection(type) ⇒ Object
Define an array of given type
76 77 78 79 |
# File 'lib/hanami/model/types.rb', line 76 def Collection(type) type = Schema::CoercibleType.new(type) unless type.is_a?(Dry::Types::Definition) Types::Array.member(type) end |
#Entity(type) ⇒ Object
Define an entity of the given type
46 47 48 49 |
# File 'lib/hanami/model/types.rb', line 46 def Entity(type) type = Schema::CoercibleType.new(type) unless type.is_a?(Dry::Types::Definition) type end |