diff --git a/lib/register/instructions/get_byte.rb b/lib/register/instructions/get_byte.rb index e33bb412..b888953d 100644 --- a/lib/register/instructions/get_byte.rb +++ b/lib/register/instructions/get_byte.rb @@ -16,10 +16,6 @@ module Register # end # attr_accessor :array , :index , :register - def to_s - "GetByte: #{array}[#{index}] -> #{register}" - end - end # Produce a GetByte instruction. diff --git a/lib/register/instructions/get_slot.rb b/lib/register/instructions/get_slot.rb index 004e4c23..ad9f6f4e 100644 --- a/lib/register/instructions/get_slot.rb +++ b/lib/register/instructions/get_slot.rb @@ -20,10 +20,6 @@ module Register # end # attr_accessor :array , :index , :register - def to_s - "GetSlot: #{array}[#{index}] -> #{register}" - end - end # Produce a GetSlot instruction. diff --git a/lib/register/instructions/getter.rb b/lib/register/instructions/getter.rb index 3921fd04..c3292355 100644 --- a/lib/register/instructions/getter.rb +++ b/lib/register/instructions/getter.rb @@ -29,6 +29,10 @@ module Register end attr_accessor :array , :index , :register + def to_s + "#{self.class.name}: #{array}[#{index}] -> #{register}" + end + end end diff --git a/lib/register/instructions/set_byte.rb b/lib/register/instructions/set_byte.rb index c2a3116c..f0052002 100644 --- a/lib/register/instructions/set_byte.rb +++ b/lib/register/instructions/set_byte.rb @@ -6,10 +6,6 @@ module Register class SetByte < Setter - def to_s - "SetByte: #{register} -> #{array} [#{index}]" - end - end # Produce a SetByte instruction. diff --git a/lib/register/instructions/set_slot.rb b/lib/register/instructions/set_slot.rb index d0a3f1f0..4500ec1f 100644 --- a/lib/register/instructions/set_slot.rb +++ b/lib/register/instructions/set_slot.rb @@ -20,10 +20,6 @@ module Register # end # attr_accessor :register , :array , :index - def to_s - "SetSlot: #{register} -> #{array} [#{index}]" - end - end # Produce a SetSlot instruction. diff --git a/lib/register/instructions/setter.rb b/lib/register/instructions/setter.rb index ee366372..ef9de905 100644 --- a/lib/register/instructions/setter.rb +++ b/lib/register/instructions/setter.rb @@ -27,6 +27,10 @@ module Register end attr_accessor :register , :array , :index + def to_s + "#{self.class.name}: #{array}[#{index}] -> #{register}" + end + end end