lib/is_ok.rb in is_ok-0.0.1 vs lib/is_ok.rb in is_ok-1.1.0
- old
+ new
@@ -1,6 +1,25 @@
require "is_ok/version"
module IsOK
- class Error < StandardError; end
- # Your code goes here...
+ class IsResponse
+ attr_reader :data
+
+ def initialize(data)
+ @data = data
+ end
+ end
+
+ class IsOK < IsResponse ; end
+
+ class IsError < IsResponse ; end
+
+ class << self
+ def ok(data)
+ IsOK.new(data)
+ end
+
+ def error(data)
+ IsError.new(data)
+ end
+ end
end