Module: Hanami::Model::Types::ClassMethods
- Defined in:
- lib/hanami/model/types.rb
Overview
Class level interface
rubocop:disable Naming/MethodName
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
75 76 77 78 |
# File 'lib/hanami/model/types.rb', line 75 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
45 46 47 48 |
# File 'lib/hanami/model/types.rb', line 45 def Entity(type) type = Schema::CoercibleType.new(type) unless type.is_a?(Dry::Types::Definition) type end |