Class: Phlexing::Options
- Inherits:
-
Object
- Object
- Phlexing::Options
- Defined in:
- lib/phlexing/options.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
(also: #component?)
Returns the value of attribute component.
-
#component_name ⇒ Object
Returns the value of attribute component_name.
-
#parent_component ⇒ Object
Returns the value of attribute parent_component.
-
#svg_param ⇒ Object
Returns the value of attribute svg_param.
-
#template_name ⇒ Object
Returns the value of attribute template_name.
-
#whitespace ⇒ Object
(also: #whitespace?)
Returns the value of attribute whitespace.
Instance Method Summary collapse
-
#initialize(component: false, component_name: "Component", parent_component: "Phlex::HTML", whitespace: true, svg_param: "s", template_name: "view_template") ⇒ Options
constructor
A new instance of Options.
- #safe_constant_name(name) ⇒ Object
Constructor Details
#initialize(component: false, component_name: "Component", parent_component: "Phlex::HTML", whitespace: true, svg_param: "s", template_name: "view_template") ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 15 16 17 |
# File 'lib/phlexing/options.rb', line 10 def initialize(component: false, component_name: "Component", parent_component: "Phlex::HTML", whitespace: true, svg_param: "s", template_name: "view_template") @component = component @component_name = safe_constant_name(component_name) @parent_component = safe_constant_name(parent_component) @whitespace = whitespace @svg_param = svg_param @template_name = template_name end |
Instance Attribute Details
#component ⇒ Object Also known as: component?
Returns the value of attribute component.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def component @component end |
#component_name ⇒ Object
Returns the value of attribute component_name.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def component_name @component_name end |
#parent_component ⇒ Object
Returns the value of attribute parent_component.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def parent_component @parent_component end |
#svg_param ⇒ Object
Returns the value of attribute svg_param.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def svg_param @svg_param end |
#template_name ⇒ Object
Returns the value of attribute template_name.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def template_name @template_name end |
#whitespace ⇒ Object Also known as: whitespace?
Returns the value of attribute whitespace.
5 6 7 |
# File 'lib/phlexing/options.rb', line 5 def whitespace @whitespace end |
Instance Method Details
#safe_constant_name(name) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/phlexing/options.rb', line 19 def safe_constant_name(name) name = name.to_s if name[0] == "0" || name[0].to_i != 0 "A#{name}" else name end end |