lib/vedeu/interfaces/clear.rb in vedeu-0.8.0 vs lib/vedeu/interfaces/clear.rb in vedeu-0.8.1
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Vedeu
module Interfaces
# Clear the named interface.
@@ -81,11 +83,11 @@
private
# @return [String] A string of blank characters.
def chars
- @chars ||= (' ' * width).freeze
+ @chars ||= (' ' * width)
end
# @return [Vedeu::Colours::Colour]
def colour
@colour ||= interface.colour
@@ -137,11 +139,11 @@
defaults.merge!(@options)
end
# @return [String]
def optimised_output
- Vedeu.timer("Optimised clearing #{clearing}: '#{name}'".freeze) do
+ Vedeu.timer("Optimised clearing #{clearing}: '#{name}'") do
height.times.map do |iy|
[
build_position(y + iy, x),
colour.to_s,
chars,
@@ -155,11 +157,11 @@
# defined, then starting write space characters over the area
# which the interface occupies.
#
# @return [Array<Array<Vedeu::Views::Char>>]
def output
- Vedeu.timer("Clearing #{clearing}: '#{name}'".freeze) do
+ Vedeu.timer("Clearing #{clearing}: '#{name}'") do
@clear ||= Array.new(height) do |iy|
Array.new(width) do |ix|
Vedeu::Cells::Clear.new(colour: colour,
name: name,
position: [y + iy, x + ix])
@@ -169,13 +171,13 @@
end
# @return [String]
def clearing
@clearing ||= if content_only?
- 'content'.freeze
+ 'content'
else
- 'interface'.freeze
+ 'interface'
end
end
# @param pos_y [Fixnum]