Class: LocalPac::ProxyPac::PacResultHtmlStylist
- Inherits:
-
Object
- Object
- LocalPac::ProxyPac::PacResultHtmlStylist
- Defined in:
- lib/local_pac/proxy_pac/pac_result_html_stylist.rb
Instance Attribute Summary collapse
-
#class_element_container ⇒ Object
readonly
Returns the value of attribute class_element_container.
-
#class_header ⇒ Object
readonly
Returns the value of attribute class_header.
-
#class_main_container ⇒ Object
readonly
Returns the value of attribute class_main_container.
-
#class_proxy ⇒ Object
readonly
Returns the value of attribute class_proxy.
-
#class_proxy_port ⇒ Object
readonly
Returns the value of attribute class_proxy_port.
-
#class_request_type ⇒ Object
readonly
Returns the value of attribute class_request_type.
-
#class_unimportant ⇒ Object
readonly
Returns the value of attribute class_unimportant.
-
#html_data ⇒ Object
readonly
Returns the value of attribute html_data.
-
#html_style ⇒ Object
readonly
Returns the value of attribute html_style.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PacResultHtmlStylist
constructor
A new instance of PacResultHtmlStylist.
- #style_me(result) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PacResultHtmlStylist
Returns a new instance of PacResultHtmlStylist.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 6 def initialize( = {}) @class_main_container = .fetch(:class_main_container, 'lp_main_container') @class_element_container = .fetch(:class_element_container, 'lp_element_container') @class_request_type = .fetch(:class_request_type, 'lp_request_type') @class_proxy = .fetch(:class_proxy, 'lp_proxy') @class_proxy_port = .fetch(:class_proxy_port, 'lp_proxy_port') @class_unimportant = .fetch(:class_unimportant, 'lp_unimportant') @class_header = .fetch(:class_header, 'lp_header') #@html_style = options.fetch(:html_style, HTMLTableStyle.new(main_container_class: class_main_container, element_container_class: class_element_container)) @html_style = .fetch(:html_style, HTMLDivStyle.new(main_container_css_class: class_main_container, element_container_css_class: class_element_container)) @html_data = .fetch(:html_styler, HTMLData) end |
Instance Attribute Details
#class_element_container ⇒ Object (readonly)
Returns the value of attribute class_element_container.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_element_container @class_element_container end |
#class_header ⇒ Object (readonly)
Returns the value of attribute class_header.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_header @class_header end |
#class_main_container ⇒ Object (readonly)
Returns the value of attribute class_main_container.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_main_container @class_main_container end |
#class_proxy ⇒ Object (readonly)
Returns the value of attribute class_proxy.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_proxy @class_proxy end |
#class_proxy_port ⇒ Object (readonly)
Returns the value of attribute class_proxy_port.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_proxy_port @class_proxy_port end |
#class_request_type ⇒ Object (readonly)
Returns the value of attribute class_request_type.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_request_type @class_request_type end |
#class_unimportant ⇒ Object (readonly)
Returns the value of attribute class_unimportant.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def class_unimportant @class_unimportant end |
#html_data ⇒ Object (readonly)
Returns the value of attribute html_data.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def html_data @html_data end |
#html_style ⇒ Object (readonly)
Returns the value of attribute html_style.
4 5 6 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 4 def html_style @html_style end |
Instance Method Details
#style_me(result) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/local_pac/proxy_pac/pac_result_html_stylist.rb', line 19 def style_me(result) html_style.add_data(html_data.new(element: result.request_type, element_css_class: class_request_type, header: I18n.t('models.data.request_type'), header_css_class: class_header )) if result.proxy html_style.add_data(html_data.new(element: result.proxy, element_css_class: class_proxy, header: I18n.t('models.data.proxy'), header_css_class: class_header )) end if result.proxy_port html_style.add_data(html_data.new(element: result.proxy_port, element_css_class: class_request_type, header: I18n.t('models.data.proxy_port'), header_css_class: class_header )) end result.styled_content = html_style.to_s end |