Class: Cease::Eviction::Scope
- Inherits:
-
Object
- Object
- Cease::Eviction::Scope
- Extended by:
- Forwardable
- Defined in:
- lib/cease/eviction/scope.rb
Instance Method Summary collapse
- #format ⇒ Array<String>
-
#initialize(chunk:, comments:, statement:) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(chunk:, comments:, statement:) ⇒ Scope
Returns a new instance of Scope.
13 14 15 16 17 |
# File 'lib/cease/eviction/scope.rb', line 13 def initialize(chunk:, comments:, statement:) @chunk = chunk @comments = comments @statement = statement end |
Instance Method Details
#format ⇒ Array<String>
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cease/eviction/scope.rb', line 20 def format length = formatted_lines.length case length when (0..25) then formatted_lines else [ formatted_lines[0..10], formatted_lines[11] << "\n", Rainbow("...#{line_count - 12} line(s) truncated.").yellow ].flatten end end |