From 7a42644b3bca819420aea49f76740f55191550f2 Mon Sep 17 00:00:00 2001 From: Stormwind Date: Sun, 22 Feb 2015 22:32:39 +0100 Subject: [PATCH] Add possibility to change symbol sets --- lib/rubella/output/ascii.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/rubella/output/ascii.rb b/lib/rubella/output/ascii.rb index ebc811b..f4fe79e 100644 --- a/lib/rubella/output/ascii.rb +++ b/lib/rubella/output/ascii.rb @@ -17,7 +17,16 @@ module Rubella [" ", "1", "2", "3", "4", "5", "6", "7", "8", "9"] @field_size = field_size - @used_symbols = "shades_ascii" + self.used_symbols = "shades_ascii" + end + + def used_symbols= value + if @symbols.has_key? value + @used_symbols = value + return + end + raise ArgumentError, "Symbol set not found, must be one of: " + + @symbols.keys.join(", ") end def create parsed_list @@ -50,7 +59,6 @@ module Rubella ascii_arr.join("\n") end - end end