Class: UltraSettings::WebView
- Inherits:
-
Object
- Object
- UltraSettings::WebView
- Defined in:
- lib/ultra_settings/web_view.rb
Overview
Helper class for rendering the settings information in an HTML page.
Instance Attribute Summary collapse
-
#layout_css ⇒ Object
readonly
Returns the value of attribute layout_css.
Instance Method Summary collapse
-
#content ⇒ String
Get the content for the settings page.
-
#initialize(color_scheme: :light) ⇒ WebView
constructor
Initialize a new WebView with the specified color scheme.
-
#render_settings ⇒ String
Render the complete settings page HTML.
Constructor Details
#initialize(color_scheme: :light) ⇒ WebView
Initialize a new WebView with the specified color scheme.
12 13 14 15 16 |
# File 'lib/ultra_settings/web_view.rb', line 12 def initialize(color_scheme: :light) @color_scheme = (color_scheme || :light).to_sym @layout_template = ViewHelper.erb_template("layout.html.erb") @layout_css = scheme_layout_css(@color_scheme) end |
Instance Attribute Details
#layout_css ⇒ Object (readonly)
Returns the value of attribute layout_css.
6 7 8 |
# File 'lib/ultra_settings/web_view.rb', line 6 def layout_css @layout_css end |
Instance Method Details
#content ⇒ String
Get the content for the settings page.
28 29 30 |
# File 'lib/ultra_settings/web_view.rb', line 28 def content UltraSettings::ApplicationView.new(color_scheme: @color_scheme).render end |
#render_settings ⇒ String
Render the complete settings page HTML.
21 22 23 |
# File 'lib/ultra_settings/web_view.rb', line 21 def render_settings @layout_template.result(binding) end |