class Plinko::Validator

Attributes

value[RW]

Public Class Methods

new(value) click to toggle source
# File lib/plinko/validator.rb, line 5
def initialize(value)
  self.value = value
end
validate(value) click to toggle source
# File lib/plinko/validator.rb, line 9
def self.validate(value)
  new(value).validate
end

Public Instance Methods

error_message() click to toggle source
# File lib/plinko/validator.rb, line 25
def error_message
  "An error occurred."
end
validate() click to toggle source
# File lib/plinko/validator.rb, line 13
def validate
  if validation
    value
  else
    [value, [error_message]]      
  end
end
validation() click to toggle source
# File lib/plinko/validator.rb, line 21
def validation
  true
end