Class: Pfm::Validator::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/iapi-idlc-sdk-pfm/validator.rb

Overview

This is here to hold attr_accessor data for Validator context variables

Class Method Summary collapse

Class Method Details

.add_attr(name) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/iapi-idlc-sdk-pfm/validator.rb', line 5

def self.add_attr(name)
  @attributes ||= []

  unless @attributes.include?(name)
    @attributes << name
    attr_accessor(name)
  end
end

.resetObject



14
15
16
17
18
19
20
21
22
# File 'lib/iapi-idlc-sdk-pfm/validator.rb', line 14

def self.reset
  return if @attributes.nil?

  @attributes.each do |attr|
    remove_method(attr)
  end

  @attributes = nil
end