Class: Percheron::Validators::Stack
- Inherits:
-
Object
- Object
- Percheron::Validators::Stack
- Defined in:
- lib/percheron/validators/stack.rb
Instance Method Summary collapse
-
#initialize(stack) ⇒ Stack
constructor
A new instance of Stack.
- #valid? ⇒ Boolean
Constructor Details
#initialize(stack) ⇒ Stack
Returns a new instance of Stack.
5 6 7 |
# File 'lib/percheron/validators/stack.rb', line 5 def initialize(stack) @stack = stack end |
Instance Method Details
#valid? ⇒ Boolean
9 10 11 12 |
# File 'lib/percheron/validators/stack.rb', line 9 def valid? = rules.return { |rule| send(rule) } ? fail(Errors::StackInvalid, ()) : true end |