Skip to content

Instantly share code, notes, and snippets.

/_kincom.rb Secret

Created July 27, 2016 21:15
Show Gist options
  • Save anonymous/e6e2c418e2bfc9d174172cf5b7bac787 to your computer and use it in GitHub Desktop.
Save anonymous/e6e2c418e2bfc9d174172cf5b7bac787 to your computer and use it in GitHub Desktop.
module KincomValidator
def validate(file, options)
is_file_valid?(file)
is_options_valid?(options)
end
def is_file_valid?(file)
validate_file_extension(file)
#Kunne udbygges med flere checks. Readable, etc?
end
end
require_relative '_kincom'
module ValidationHelper
def kincom
include KincomValidator
end
module_function :kincom
end
require_relative './kincom/kincom'
require_relative './validations/validation_helper.rb'
class XerciseClass
include ValidationHelper
attr_reader :whoamI
def initialize
@whoamI = "I am an Xercise instance. I should not ever be called. Should I maybe be a module instead?"
end
def kincom(file, options)
ValidationHelper::kincom
KincomValidator::validate(file, options)
Kincom.new(file, options)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment