Commit Graph

4 Commits

Author SHA1 Message Date
Luca Guidi 1b4ae84741
Update to: hanami-utils v1.1.0.beta2, dry-validation 0.11, hanami-devtools, rubocop 0.50.0 2017-10-03 11:22:02 +02:00
Luca Guidi 56f486f6ec Ignore rubocop artifact 2016-12-20 10:59:32 +01:00
Luca Guidi e9e309df5b Introduced coercions ✈️
Example:
  require 'lotus/validations'

  class SignupParams
    include Lotus::Validations

    attribute :name, type: String
    attribute :age,  type: Integer
    attribute :untyped
  end

  params = SignupParams.new({ name: 'Luca', age: '32', untyped: '3.14' })
  params.valid?

  params.name     # => "Luca"
  params.age      # => 32
  params.untyped  # => 3.14, it isn't coerced
2014-08-03 18:18:32 +02:00
Luca Guidi 298978a7f8 Initial mess 2014-08-03 17:29:55 +02:00