Class: CutePrint::InlineLabeler Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cute_print/inline_labeler.rb

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.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(formatter, width, label, value) ⇒ InlineLabeler

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.

Returns a new instance of InlineLabeler.



9
10
11
12
13
14
# File 'lib/cute_print/inline_labeler.rb', line 9

def initialize(formatter, width, label, value)
  @formatter = formatter
  @width = width
  @label = label
  @value = value
end

Class Method Details

.label(formatter, width, label, value) ⇒ Object

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.



5
6
7
# File 'lib/cute_print/inline_labeler.rb', line 5

def self.label(formatter, width, label, value)
  new(formatter, width, label, value).labeled
end

Instance Method Details

#labeledObject

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.



16
17
18
# File 'lib/cute_print/inline_labeler.rb', line 16

def labeled
  [@label.rstrip + "\n"] + indented_lines
end