Class: RestMyCase::AccusationAttorneys::Base
- Inherits:
-
Object
- Object
- RestMyCase::AccusationAttorneys::Base
- Defined in:
- lib/rest_my_case/accusation_attorneys/base.rb
Overview
I DO NOT CLAIM OWNERSHIP OF THIS CODE, THIS CODE WAS TAKEN FROM “ActiveModel” GEM AND ADAPTED TO RUN WITHOUT “ActiveSupport” ORIGINAL SOURCE FILE: ActiveModel::Validator
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#validate(record) ⇒ Object
Override this method in subclasses with validation logic, adding errors to the records
errorsarray where necessary.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 14 def initialize( = {}) = Helpers.except(, :class).freeze end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
10 11 12 |
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 10 def base @base end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 12 def end |
Instance Method Details
#validate(record) ⇒ Object
Override this method in subclasses with validation logic, adding errors to the records errors array where necessary.
20 21 22 |
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 20 def validate(record) fail NotImplementedError, "Subclasses must implement a validate(record) method." end |