Class: Translatomatic::Config::Display
- Inherits:
-
Object
- Object
- Translatomatic::Config::Display
- Includes:
- Util
- Defined in:
- lib/translatomatic/config/display.rb
Overview
Methods for displaying configuration
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#config_table_body ⇒ Array<Array<String>>
Configuration table.
-
#initialize(opts = {}) ⇒ Display
constructor
A new instance of Display.
Constructor Details
#initialize(opts = {}) ⇒ Display
Returns a new instance of Display.
7 8 9 10 11 |
# File 'lib/translatomatic/config/display.rb', line 7 def initialize(opts = {}) @options = opts @config_params = opts[:config_params] raise t('config.one_at_a_time') if opts[:user] && opts[:project] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/translatomatic/config/display.rb', line 5 def @options end |
Instance Method Details
#config_table_body ⇒ Array<Array<String>>
Returns Configuration table.
14 15 16 17 18 19 20 21 22 |
# File 'lib/translatomatic/config/display.rb', line 14 def config_table_body columns = [:columns] || [] rows = config_table_rows(columns) if rows.present? headings = columns.collect { |i| CONFIG_HEADING_MAP[i] } rows = add_table_heading(rows, headings) end rows end |