Permalink
Browse files

clean arbitrary.rb

  • Loading branch information...
1 parent 8135f66 commit 9376051365c5c3f5608f71b892af5e775c71c081 Daisuke IKEGAMI committed Mar 30, 2011
Showing with 16 additions and 19 deletions.
  1. +16 −19 lib/rushcheck/arbitrary.rb
View
@@ -32,26 +32,23 @@
module RushCheck
- module ParseError
-
- # :nodoc:
- def _message_should_be_overrided
- /^.+?:\d+(?::in (`.*'))?/ =~ caller.first
- [ "The method", $1, "should be overrided at",
- self.class.to_s ].join(" ") + "."
- end
-
- private :_message_should_be_overrided
-
+ # :nodoc:
+ def _message_should_be_overrided
+ /^.+?:\d+(?::in (`.*'))?/ =~ caller.first
+ [ "The method", $1, "should be overrided at",
+ self.class.to_s ].join(" ") + "."
end
+ private :_message_should_be_overrided
+
module Arbitrary
- include RushCheck::ParseError
+ include RushCheck
- # It is assumed that the _arbitrary_ method must be overrided
- # as a instance method, and return a Gen object with the same
- # class of self.
+ # A generator for values of the object.
+ # It is an instance-specific method. The method must be
+ # overrided as a instance method, and return a Gen object
+ # with the same class of self.
def arbitrary
raise(NotImplementedError, _message_should_be_overrided)
end
@@ -60,11 +57,11 @@ def arbitrary
module Coarbitrary
- include RushCheck::ParseError
+ include RushCheck
- # It is assumed that the _coarbitrary_ method must be overrided
- # as a class method which takes one argument of Gen
- # and return a Gen object.
+ # Used to generate a function of self to other.
+ # The method must be overrided as a class method which
+ # takes one argument of Gen and return a Gen object.
def coarbitrary(g)
raise(NotImplementedError, _message_should_be_overrided)
end

0 comments on commit 9376051

Please sign in to comment.