class Hecks::Adapters::Validator
Attributes
args[R]
errors[R]
head_spec[R]
Public Class Methods
new(command:)
click to toggle source
# File lib/hecks-validator.rb, line 6 def initialize(command:) @args = command.args @head_spec = command.domain_module.head @errors = {} end
Public Instance Methods
call()
click to toggle source
# File lib/hecks-validator.rb, line 12 def call validate return self end
Private Instance Methods
missing_attributes()
click to toggle source
# File lib/hecks-validator.rb, line 28 def missing_attributes head_spec.attribute_hash.keys - args.keys end
validate()
click to toggle source
# File lib/hecks-validator.rb, line 21 def validate (missing_attributes).each do |missing_attribute| errors[missing_attribute] = [] errors[missing_attribute] << "missing" end end