Class: Hatch::Errors

Inherits:
Hash
  • Object
show all
Defined in:
lib/hatch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(validated_attributes) ⇒ Object



162
163
164
# File 'lib/hatch.rb', line 162

def self.build(validated_attributes)
  self[attributes_and_errors(validated_attributes)]
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


174
175
176
# File 'lib/hatch.rb', line 174

def empty?
  full_messages.empty?
end

#full_messagesObject



170
171
172
# File 'lib/hatch.rb', line 170

def full_messages
  values.reject {|value| value.empty?}
end

#on(attr) ⇒ Object



166
167
168
# File 'lib/hatch.rb', line 166

def on(attr)
  self[attr]
end