class PnoteClient::ConsoleDisplay
Public Class Methods
new()
click to toggle source
implement HmlToPnoteConverter Delegate implement PnoteClient
Delegate
# File lib/pnote_client/display/console_display.rb, line 6 def initialize end
Public Instance Methods
binary_converted(count:, current:)
click to toggle source
# File lib/pnote_client/display/console_display.rb, line 18 def binary_converted(count:, current:) print_progress(count, current, "바이너리 파일 변환 중") # Print newline when task is done if count == (current + 1) printf("\n") end end
paragraph_converted(count:, current:)
click to toggle source
# File lib/pnote_client/display/console_display.rb, line 9 def paragraph_converted(count:, current:) print_progress(count, current, "문단 변환 중") # Print newline when task is done if count == (current + 1) printf("\n") end end
Private Instance Methods
percentage(count, current)
click to toggle source
# File lib/pnote_client/display/console_display.rb, line 33 def percentage(count, current) return ((100.0 / count) * current) end
print_progress(count, current, title)
click to toggle source
# File lib/pnote_client/display/console_display.rb, line 29 def print_progress(count, current, title) printf("\r[#{title}] #{current + 1}/#{count} [%-20s]", "=" * (percentage(count, current + 1) / 5) + ">") end