Module: Fend::Plugins::Core::ResultMethods
- Defined in:
- lib/fend.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Get raw input data.
-
#output ⇒ Object
readonly
Get output data.
Instance Method Summary collapse
-
#failure? ⇒ Boolean
Check if if validation failed.
- #fend_class ⇒ Object
- #initialize(args = {}) ⇒ Object
- #inspect ⇒ Object
-
#messages ⇒ Object
Get error messages.
-
#success? ⇒ Boolean
Check if if validation succeeded.
- #to_s ⇒ Object
Instance Attribute Details
#input ⇒ Object (readonly)
Get raw input data
271 272 273 |
# File 'lib/fend.rb', line 271 def input @input end |
#output ⇒ Object (readonly)
Get output data
274 275 276 |
# File 'lib/fend.rb', line 274 def output @output end |
Instance Method Details
#failure? ⇒ Boolean
Check if if validation failed
290 291 292 |
# File 'lib/fend.rb', line 290 def failure? !success? end |
#fend_class ⇒ Object
299 300 301 |
# File 'lib/fend.rb', line 299 def fend_class self.class.fend_class end |
#initialize(args = {}) ⇒ Object
276 277 278 279 280 |
# File 'lib/fend.rb', line 276 def initialize(args = {}) @input = args.fetch(:input) @output = args.fetch(:output) @errors = args.fetch(:errors) end |
#inspect ⇒ Object
303 304 305 |
# File 'lib/fend.rb', line 303 def inspect "#{fend_class.inspect}::Result" end |
#messages ⇒ Object
Get error messages
283 284 285 286 287 |
# File 'lib/fend.rb', line 283 def return {} if success? @errors end |
#success? ⇒ Boolean
Check if if validation succeeded
295 296 297 |
# File 'lib/fend.rb', line 295 def success? @errors.empty? end |
#to_s ⇒ Object
307 308 309 |
# File 'lib/fend.rb', line 307 def to_s "#{fend_class.inspect}::Result" end |