Class: SipoMailer::Models::Contact

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/sipo_mailer/models/contact.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.valid?(params) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
22
# File 'lib/sipo_mailer/models/contact.rb', line 15

def self.valid?(params)
  schema = Dry::Validation.Schema do
    required(:cislo).filled
    required(:email).filled
  end

  schema.call(params).errors.empty?
end

Instance Method Details

#idObject



11
12
13
# File 'lib/sipo_mailer/models/contact.rb', line 11

def id
  cislo
end