Class: RestMyCase::AccusationAttorneys::Custom

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

Instance Attribute Summary collapse

Attributes inherited from Base

#base, #options

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Custom



8
9
10
11
12
# File 'lib/rest_my_case/accusation_attorneys/custom.rb', line 8

def initialize(args)
  @methods = args

  super Helpers.extract_options!(args)
end

Instance Attribute Details

#methodsObject (readonly)

Returns the value of attribute methods.



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

def methods
  @methods
end

Instance Method Details

#validate(record) ⇒ Object



14
15
16
# File 'lib/rest_my_case/accusation_attorneys/custom.rb', line 14

def validate(record)
  [*methods].map { |method| base.send(method, record) }.all?
end