Class: I18nFlow::CLI::SearchCommand::DefaultRenderer
- Inherits:
-
Object
- Object
- I18nFlow::CLI::SearchCommand::DefaultRenderer
- Includes:
- Color
- Defined in:
- lib/i18n_flow/cli/search_command/default_renderer.rb
Constant Summary collapse
- FILE =
__dir__ + '/default.erb'
Constants included from Color
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #color_enabled? ⇒ Boolean
-
#initialize(results, color: true) ⇒ DefaultRenderer
constructor
A new instance of DefaultRenderer.
- #render ⇒ Object
Methods included from Color
Constructor Details
#initialize(results, color: true) ⇒ DefaultRenderer
Returns a new instance of DefaultRenderer.
13 14 15 16 |
# File 'lib/i18n_flow/cli/search_command/default_renderer.rb', line 13 def initialize(results, color: true) @results = results @color_enabled = !!color end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
11 12 13 |
# File 'lib/i18n_flow/cli/search_command/default_renderer.rb', line 11 def results @results end |
Instance Method Details
#color_enabled? ⇒ Boolean
22 23 24 |
# File 'lib/i18n_flow/cli/search_command/default_renderer.rb', line 22 def color_enabled? @color_enabled end |
#render ⇒ Object
18 19 20 |
# File 'lib/i18n_flow/cli/search_command/default_renderer.rb', line 18 def render with_color(erb.result(binding)) end |