diff --git a/lib/rubella.rb b/lib/rubella.rb index 93b1304..5e7c84d 100644 --- a/lib/rubella.rb +++ b/lib/rubella.rb @@ -1,24 +1,27 @@ module Rubella class Map + attr_reader :input + attr_reader :output + attr_reader :weighting - def initialize(input, output, weighting) + def initialize(input_name, output_name, weighting_name) - case input + @input = case input_name when "json" then self.input_json else - raise NotImplementedError, "Not supported input type "+input+" given" + raise NotImplementedError, "Not supported input type "+input_name+" given" end - case output + @output = case output_name when "image" then self.output_image else - raise NotImplementedError, "Not supported output type "+output+" given" + raise NotImplementedError, "Not supported output type "+output_name+" given" end - case weighting + @weighting = case weighting_name when "per_value" then self.weighting_per_value when "per_overall_load" then @@ -26,29 +29,34 @@ module Rubella when "expotential" then self.weighting_expotential else - raise NotImplementedError, "Not supported weighting type "+weighting+" given" + raise NotImplementedError, "Not supported weighting type "+weighting_name+" given" end - + end def input_json require "rubella/input/json" + Input::JSON end def output_image require "rubella/output/image" + Output::Image end def weighting_per_value require "rubella/weighting/per_value" + Weighting::PerValue end def weighting_per_overall_load require "rubella/weighting/per_overall_load" + Weighting::PerOverallLoad end def weighting_expotential require "rubella/weighting/expotential" + Weighting::Expotential end end diff --git a/lib/rubella/output/image.rb b/lib/rubella/output/image.rb index e69de29..aa09a4b 100644 --- a/lib/rubella/output/image.rb +++ b/lib/rubella/output/image.rb @@ -0,0 +1,8 @@ +module Rubella + module Output + + class Image + end + + end +end diff --git a/lib/rubella/weighting/exponential.rb b/lib/rubella/weighting/exponential.rb index e69de29..ff8420b 100644 --- a/lib/rubella/weighting/exponential.rb +++ b/lib/rubella/weighting/exponential.rb @@ -0,0 +1,8 @@ +module Rubella + module Weighting + + class Expotential + end + + end +end diff --git a/lib/rubella/weighting/per_overall_load.rb b/lib/rubella/weighting/per_overall_load.rb index e69de29..073cdf5 100644 --- a/lib/rubella/weighting/per_overall_load.rb +++ b/lib/rubella/weighting/per_overall_load.rb @@ -0,0 +1,8 @@ +module Rubella + module Weighting + + class PerOverallLoad + end + + end +end diff --git a/lib/rubella/weighting/per_value.rb b/lib/rubella/weighting/per_value.rb index 5c24b35..bdd4e8c 100644 --- a/lib/rubella/weighting/per_value.rb +++ b/lib/rubella/weighting/per_value.rb @@ -1,5 +1,5 @@ module Rubella - module Weigthing + module Weighting # Gets an input object and prepares the data for the output. #