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



138
139
140
# File 'lib/hatch.rb', line 138

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

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


150
151
152
# File 'lib/hatch.rb', line 150

def empty?
  full_messages.empty?
end

#full_messagesObject



146
147
148
# File 'lib/hatch.rb', line 146

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

#on(attr) ⇒ Object



142
143
144
# File 'lib/hatch.rb', line 142

def on(attr)
  self[attr]
end