class Pug::Types::Result
Encapsulates a sucess/failure result @!attribute type
@return [Integer] the type of the Result @see Result::SUCCESS @see Result::INFO @see Result::ERROR
@!attribute value
@return [String] the value of the Result @note exists only for SUCCESS and INFO types
@!attribute error
@return [String] the output of the Action @note exists only for ERROR type
Constants
- ERROR
- INFO
- SUCCESS
@!group
Types
Attributes
error[R]
type[R]
value[R]
Public Class Methods
error(error)
click to toggle source
info(value)
click to toggle source
new(type, value, error)
click to toggle source
@!visibility private
# File lib/pug/types/result.rb, line 28 def initialize(type, value, error) raise 'Invalid type' unless [SUCCESS, INFO, ERROR].include?(type) @type = type @value = value @error = error end