Class: ActiveHook::Validate
- Inherits:
-
Object
- Object
- ActiveHook::Validate
- Defined in:
- lib/activehook/validate.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Validate
constructor
A new instance of Validate.
- #perform ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Validate
Returns a new instance of Validate.
5 6 7 |
# File 'lib/activehook/validate.rb', line 5 def initialize( = {}) .each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/activehook/validate.rb', line 3 def id @id end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/activehook/validate.rb', line 3 def key @key end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 14 |
# File 'lib/activehook/validate.rb', line 9 def perform validate! @key == find_key rescue false end |