Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove unneded Aequitas::ClassMethods

  • Loading branch information...
commit 3720ce4327ad7d216dbd58c8fa37b8cddf2337a9 1 parent c3aca34
Markus Schirp authored
Showing with 0 additions and 73 deletions.
  1. +0 −1  lib/aequitas.rb
  2. +0 −72 lib/aequitas/class_methods.rb
View
1  lib/aequitas.rb
@@ -47,7 +47,6 @@ def inspect
require 'aequitas/evaluator'
require 'aequitas/dsl'
require 'aequitas/dsl/evaluator'
-require 'aequitas/class_methods'
require 'aequitas/instance_methods'
require 'aequitas/validator'
require 'aequitas/validator/builder'
View
72 lib/aequitas/class_methods.rb
@@ -1,72 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-
-module Aequitas
- # Class methods mixed into aequitas validators
- module ClassMethods
- include DSL
-
- # Return the validator
- #
- # @return [Validator]
- #
- # @api private
- #
- def validator
- @validator ||= Validator::EMPTY
- end
-
-
- # Add a rule
- #
- # @param [Rule] rule
- #
- # @return [self]
- #
- # @api private
- #
- def add(rule)
- @validator = validator.add(rule)
- end
-
- # Return violations for resource
- #
- # @param [Resource] resource
- #
- # @return [Evaluation]
- #
- # @api private
- #
- def validate(resource)
- validator.validate(resource)
- end
-
- # Return rules for attribute
- #
- # @param [Symbol] attribute_name
- #
- # @return [Enumerable<Rule>]
- #
- # @api private
- #
- def on(attribute_name)
- validator.on(attribute_name)
- end
-
- private
-
- # Hook called when module is included
- #
- # @param [Class|Module] descendant
- #
- # @api private
- #
- def inherited(descendant)
- super
- validator.each do |rule|
- descendant.add(rule)
- end
- end
-
- end # module ClassMethods
-end # module Aequitas
Please sign in to comment.
Something went wrong with that request. Please try again.