Class: ActiveHook::Validate

Inherits:
Object
  • Object
show all
Defined in:
lib/activehook/validate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Validate

Returns a new instance of Validate.



5
6
7
# File 'lib/activehook/validate.rb', line 5

def initialize(options = {})
  options.each { |key, value| send("#{key}=", value) }
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/activehook/validate.rb', line 3

def id
  @id
end

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/activehook/validate.rb', line 3

def key
  @key
end

Instance Method Details

#performObject



9
10
11
12
13
14
# File 'lib/activehook/validate.rb', line 9

def perform
  validate!
  @key == find_key
rescue
  false
end