lib/porolog/scope.rb in porolog-0.0.7 vs lib/porolog/scope.rb in porolog-0.0.8

- old
+ new

@@ -14,13 +14,13 @@ # @!attribute [r] name # Name of the Scope. class Scope # Error class for rescuing or detecting any Scope error. - class ScopeError < PorologError ; end + class Error < PorologError ; end # Error class indicating a non-Predicate was assigned to a Scope. - class NotPredicateError < ScopeError ; end + class NotPredicateError < Error ; end attr_reader :name # Creates a new Scope unless it already exists. # @param name [Symbol, Object] the name (or otherwise object) used to register a scope. @@ -72,10 +72,10 @@ # @param name [Object] the name (or otherwise object) used to register a scope. # @param predicate [Porolog::Predicate] a Predicate to be assigned to the Scope. # @return [Porolog::Predicate] the Predicate assigned to the Scope. # @raise [NotPredicateError] when provided predicate is not actually a Predicate. def []=(name,predicate) - raise NotPredicateError.new("#{predicate.inspect} is not a Predicate") unless predicate.is_a?(Predicate) + raise NotPredicateError, "#{predicate.inspect} is not a Predicate" unless predicate.is_a?(Predicate) @predicates[name.to_sym] = predicate end # Returns the Predicates contained in the Scope. # @return [Array<Porolog::Predicate>] Predicates assigned to the Scope.