Class: Hanami::Model::Sql::Types::Schema::AssociationType Private
- Inherits:
-
Types::Schema::CoercibleType
- Object
- Dry::Types::Definition
- Types::Schema::CoercibleType
- Hanami::Model::Sql::Types::Schema::AssociationType
- Defined in:
- lib/hanami/model/sql/types.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Coercer for SQL associations target
Instance Method Summary collapse
- #success(*args) ⇒ Object private
-
#valid?(value) ⇒ TrueClass, FalseClass
private
Check if value can be coerced.
Methods inherited from Types::Schema::CoercibleType
Instance Method Details
#success(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
123 124 125 |
# File 'lib/hanami/model/sql/types.rb', line 123 def success(*args) result(Dry::Types::Result::Success, primitive.new(args.first.to_h)) end |
#valid?(value) ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if value can be coerced
117 118 119 |
# File 'lib/hanami/model/sql/types.rb', line 117 def valid?(value) value.inspect =~ /\[#{primitive}\]/ || super end |