From e6922a81a51d51b0d9cab2b8332374da3570745e Mon Sep 17 00:00:00 2001 From: Stormwind Date: Tue, 24 Feb 2015 20:39:55 +0100 Subject: [PATCH] Add abstract create method Now the create method belongs to the Output API and must be inmplemented in the concrete classes. I also added some docu there. --- lib/rubella/output/base.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/rubella/output/base.rb b/lib/rubella/output/base.rb index 42e2a81..3a87e73 100644 --- a/lib/rubella/output/base.rb +++ b/lib/rubella/output/base.rb @@ -1,13 +1,35 @@ module Rubella module Output + # Output base class + # The output class gets the storage within the already weighted and in + # buckets sorted content. It creates a visual representation of the given + # data and stores this local. + # class Base attr_accessor :field_size attr_reader :data - def initialize field_size = 15 + # Constructor + # Gets the field size to store it local. It's the size of one value of + # the later created visual representation. The unit depends on the kind + # of representation. + # + # @param field_size int size of one value + # @return Rubella::Output::Base + def initialize field_size @field_size = field_size end + + # Creates a visual representation of the data in the given storage and + # stores this local. + # + # @param storage Rubella::Storage + # @return Rubella::Output::Base + def create storage + raise NotImplementedError "Please override 'create' in your concrete "+ + "implementation" + end end end