Class: RestMyCase::AccusationAttorneys::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rest_my_case/accusation_attorneys/base.rb

Direct Known Subclasses

Custom, Each

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 10

def initialize(options = {})
  @options = Helpers.except(options, :class).freeze
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



6
7
8
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 6

def base
  @base
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 8

def options
  @options
end

Instance Method Details

#validate(record) ⇒ Object

Override this method in subclasses with validation logic, adding errors to the records errors array where necessary.



16
17
18
# File 'lib/rest_my_case/accusation_attorneys/base.rb', line 16

def validate(record)
  fail NotImplementedError, "Subclasses must implement a validate(record) method."
end