Class: Plinko::Validator
- Inherits:
-
Object
- Object
- Plinko::Validator
- Defined in:
- lib/plinko/validator.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(value) ⇒ Validator
constructor
A new instance of Validator.
- #validate ⇒ Object
- #validation ⇒ Object
Constructor Details
#initialize(value) ⇒ Validator
Returns a new instance of Validator.
5 6 7 |
# File 'lib/plinko/validator.rb', line 5 def initialize(value) self.value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/plinko/validator.rb', line 3 def value @value end |
Class Method Details
.validate(value) ⇒ Object
9 10 11 |
# File 'lib/plinko/validator.rb', line 9 def self.validate(value) new(value).validate end |
Instance Method Details
#error_message ⇒ Object
25 26 27 |
# File 'lib/plinko/validator.rb', line 25 def "An error occurred." end |
#validate ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/plinko/validator.rb', line 13 def validate if validation value else [value, []] end end |
#validation ⇒ Object
21 22 23 |
# File 'lib/plinko/validator.rb', line 21 def validation true end |