Class: ParamsReady::AbstractReporter
- Inherits:
-
Object
- Object
- ParamsReady::AbstractReporter
- Defined in:
- lib/params_ready/result.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #error!(err) ⇒ Object
- #for_child(name) ⇒ Object
- #full_path(path) ⇒ Object
-
#initialize(name) ⇒ AbstractReporter
constructor
A new instance of AbstractReporter.
Constructor Details
#initialize(name) ⇒ AbstractReporter
Returns a new instance of AbstractReporter.
7 8 9 |
# File 'lib/params_ready/result.rb', line 7 def initialize(name) @name = name.to_s.freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/params_ready/result.rb', line 5 def name @name end |
Instance Method Details
#error!(err) ⇒ Object
11 12 13 |
# File 'lib/params_ready/result.rb', line 11 def error!(err) report_error(nil, err) end |
#for_child(name) ⇒ Object
20 21 22 |
# File 'lib/params_ready/result.rb', line 20 def for_child(name) Reporter.new name, self end |
#full_path(path) ⇒ Object
15 16 17 18 |
# File 'lib/params_ready/result.rb', line 15 def full_path(path) return [name] if path.nil? || path.empty? [name, *path] end |