Methods
Attributes
[R] | data | |
[R] | error |
Public Class methods
[ show source ]
# File lib/facets/more/nackclass.rb, line 63 def initialize(error=nil, *data, &ctrl) if Class === error and error <= Exception @error = error.new(*data) elsif error.kind_of?( Exception ) @error = error elsif error.kind_of?( String ) @error = StandardError.new(error) elsif error == nil @error = StandardError.new else raise InvalidNackError end @data = data @ctrl = ctrl end
Public Instance methods
[ show source ]
# File lib/facets/more/nackclass.rb, line 93 def ==(x) x.is_a?(NackClass) end
[ show source ]
# File lib/facets/more/nackclass.rb, line 79 def call(*args) @ctrl.call(*args) end
[ show source ]
# File lib/facets/more/nackclass.rb, line 83 def call_with_data @ctrl.call(*@data) end
[ show source ]
# File lib/facets/more/nackclass.rb, line 97 def method_missing(meth, *args) raise_error end
[ show source ]
# File lib/facets/more/nackclass.rb, line 87 def raise_error raise @error end
[ show source ]
# File lib/facets/more/nackclass.rb, line 91 def to_s; "n/a"; end