Class: AppKernel::Function::Errors
- Includes:
- Enumerable
- Defined in:
- lib/appkernel/function.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
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
permalink #initialize ⇒ Errors
Returns a new instance of Errors.
37 38 39 40 |
# File 'lib/appkernel/function.rb', line 37 def initialize @errors = Hash.new {|h, k| h[k] = []} @all = [] end |
Instance Attribute Details
Instance Method Details
permalink #[](tag) ⇒ Object
[View source]
51 52 53 |
# File 'lib/appkernel/function.rb', line 51 def [](tag) @errors[tag] end |
permalink #add(tag, message) ⇒ Object
[View source]
42 43 44 45 |
# File 'lib/appkernel/function.rb', line 42 def add(tag, ) @errors[tag] << if tag @all << end |
permalink #each(&block) ⇒ Object
[View source]
47 48 49 |
# File 'lib/appkernel/function.rb', line 47 def each(&block) @all.each(&block) end |
permalink #empty? ⇒ Boolean
59 60 61 |
# File 'lib/appkernel/function.rb', line 59 def empty? @all.empty? end |
permalink #length ⇒ Object
[View source]
55 56 57 |
# File 'lib/appkernel/function.rb', line 55 def length @all.length end |