Class: Themis::AR::ValidationSet

Inherits:
Struct
  • Object
show all
Defined in:
lib/themis/ar/validation_set.rb

Overview

Used to store options about validation sets on every single ActiveRecord model class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ ValidationSet

Redefine ‘new` to initialize structure with hash



7
8
9
10
# File 'lib/themis/ar/validation_set.rb', line 7

def initialize(hash)
  members = self.class.members.map!(&:to_sym)
  super(*hash.values_at(*members))
end

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



5
6
7
# File 'lib/themis/ar/validation_set.rb', line 5

def block
  @block
end

#defaultObject

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



5
6
7
# File 'lib/themis/ar/validation_set.rb', line 5

def default
  @default
end

#moduleObject

Returns the value of attribute module

Returns:

  • (Object)

    the current value of module



5
6
7
# File 'lib/themis/ar/validation_set.rb', line 5

def module
  @module
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/themis/ar/validation_set.rb', line 5

def name
  @name
end

#nestedObject

Returns the value of attribute nested

Returns:

  • (Object)

    the current value of nested



5
6
7
# File 'lib/themis/ar/validation_set.rb', line 5

def nested
  @nested
end