Class: AppKernel::Function::Errors

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/appkernel/function.rb

Instance Method Summary collapse

Constructor Details

#initializeErrors

Returns a new instance of Errors.



43
44
45
46
# File 'lib/appkernel/function.rb', line 43

def initialize
  @errors = Hash.new {|h, k| h[k] = []}
  @all = []
end

Instance Method Details

#[](tag) ⇒ Object



57
58
59
# File 'lib/appkernel/function.rb', line 57

def [](tag)
  @errors[tag]
end

#add(tag, message) ⇒ Object



48
49
50
51
# File 'lib/appkernel/function.rb', line 48

def add(tag, message)
  @errors[tag] << message if tag
  @all << message
end

#each(&block) ⇒ Object



53
54
55
# File 'lib/appkernel/function.rb', line 53

def each(&block)
  @all.each(&block)
end

#empty?Boolean

Returns:



65
66
67
# File 'lib/appkernel/function.rb', line 65

def empty?
  @all.empty?
end

#lengthObject



61
62
63
# File 'lib/appkernel/function.rb', line 61

def length
  @all.length
end