Module: TextPlayer::Formatters
- Defined in:
- lib/text_player/formatters.rb,
lib/text_player/formatters/base.rb,
lib/text_player/formatters/data.rb,
lib/text_player/formatters/json.rb,
lib/text_player/formatters/text.rb,
lib/text_player/formatters/shell.rb
Overview
UI Formatters - Stream-based output handling for different interfaces
Defined Under Namespace
Classes: Base, Data, Json, Shell, Text
Class Method Summary collapse
Class Method Details
.by_name(name) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/text_player/formatters.rb', line 12 def self.by_name(name) case name when :data then Data when :json then Json when :shell then Shell else Text end end |
.create(name, command_result) ⇒ Object
21 22 23 |
# File 'lib/text_player/formatters.rb', line 21 def self.create(name, command_result) by_name(name).new(command_result) end |