Class: Termplot::FileConfig
- Inherits:
-
Object
- Object
- Termplot::FileConfig
- Defined in:
- lib/termplot/file_config.rb
Instance Attribute Summary collapse
-
#cols ⇒ Object
readonly
Returns the value of attribute cols.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#widget_configs ⇒ Object
readonly
Returns the value of attribute widget_configs.
Instance Method Summary collapse
-
#initialize(options) ⇒ FileConfig
constructor
A new instance of FileConfig.
- #parse_config ⇒ Object
- #positioned_widgets ⇒ Object
Constructor Details
#initialize(options) ⇒ FileConfig
Returns a new instance of FileConfig.
8 9 10 11 12 13 14 |
# File 'lib/termplot/file_config.rb', line 8 def initialize() @options = @path = .file @rows = .rows @cols = .cols @widget_configs = nil end |
Instance Attribute Details
#cols ⇒ Object (readonly)
Returns the value of attribute cols.
7 8 9 |
# File 'lib/termplot/file_config.rb', line 7 def cols @cols end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/termplot/file_config.rb', line 7 def @options end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
7 8 9 |
# File 'lib/termplot/file_config.rb', line 7 def rows @rows end |
#widget_configs ⇒ Object (readonly)
Returns the value of attribute widget_configs.
7 8 9 |
# File 'lib/termplot/file_config.rb', line 7 def @widget_configs end |
Instance Method Details
#parse_config ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/termplot/file_config.rb', line 16 def parse_config code = File.read(path) top_level_panel = Termplot::DSL::Col.new() top_level_panel.instance_eval(code) @widget_configs = (top_level_panel) self end |
#positioned_widgets ⇒ Object
25 26 27 |
# File 'lib/termplot/file_config.rb', line 25 def .map(&:positioned_widget) end |