-
-
Save anonymous/e6e2c418e2bfc9d174172cf5b7bac787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '_kincom' | |
module ValidationHelper | |
def kincom | |
include KincomValidator | |
end | |
module_function :kincom | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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