Class: AppKernel::Function::Errors
- Inherits:
-
Object
- Object
- AppKernel::Function::Errors
- Includes:
- Enumerable
- Defined in:
- lib/appkernel/function.rb
Instance Method Summary collapse
- #[](tag) ⇒ Object
- #add(tag, message) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ Errors
constructor
A new instance of Errors.
- #length ⇒ Object
Constructor Details
#initialize ⇒ Errors
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, ) @errors[tag] << if tag @all << end |
#each(&block) ⇒ Object
53 54 55 |
# File 'lib/appkernel/function.rb', line 53 def each(&block) @all.each(&block) end |
#length ⇒ Object
61 62 63 |
# File 'lib/appkernel/function.rb', line 61 def length @all.length end |