class Tickethub::Errors

Public Class Methods

new(errors) click to toggle source
# File lib/tickethub/errors.rb, line 4
def initialize(errors)
  @errors = errors || {}
end

Public Instance Methods

[](key) click to toggle source
# File lib/tickethub/errors.rb, line 24
def [](key)
  send key
end
full_messages_for(attribute) click to toggle source
# File lib/tickethub/errors.rb, line 8
def full_messages_for(attribute)
  send attribute
end
invalid?(attribute) click to toggle source
# File lib/tickethub/errors.rb, line 20
def invalid?(attribute)
  send(attribute).any?
end
on(attribute) click to toggle source
# File lib/tickethub/errors.rb, line 12
def on(attribute)
  @errors[attribute.to_s]
end
valid?(attribute) click to toggle source
# File lib/tickethub/errors.rb, line 16
def valid?(attribute)
  send(attribute).empty?
end

Protected Instance Methods

method_missing(method, *arguments) click to toggle source
# File lib/tickethub/errors.rb, line 30
def method_missing(method, *arguments)
  on(method) || []
end