Class: ConvenientService::Utils::String::Tab Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::String::Tab
- Defined in:
- lib/convenient_service/utils/string/tab.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #string ⇒ Object readonly private
- #tab_size ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ String private
- #initialize(string, tab_size: 2) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(string, tab_size: 2) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 40 |
# File 'lib/convenient_service/utils/string/tab.rb', line 37 def initialize(string, tab_size: 2) @string = string.to_s @tab_size = tab_size end |
Instance Attribute Details
#string ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/convenient_service/utils/string/tab.rb', line 24 def string @string end |
#tab_size ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/convenient_service/utils/string/tab.rb', line 30 def tab_size @tab_size end |
Instance Method Details
#call ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/convenient_service/utils/string/tab.rb', line 45 def call string.lines.map { |line| "#{tab}#{line}" }.join end |