Class: Tailmix::HTML::Selector
- Inherits:
-
Object
- Object
- Tailmix::HTML::Selector
- Defined in:
- lib/tailmix/html/selector.rb
Instance Method Summary collapse
-
#initialize(element_name, variant_string) ⇒ Selector
constructor
A new instance of Selector.
- #to_h ⇒ Object
Constructor Details
#initialize(element_name, variant_string) ⇒ Selector
Returns a new instance of Selector.
6 7 8 9 |
# File 'lib/tailmix/html/selector.rb', line 6 def initialize(element_name, variant_string) @element_name = element_name @variant_string = variant_string end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 |
# File 'lib/tailmix/html/selector.rb', line 11 def to_h return {} unless @element_name key = "data-tailmix-#{@element_name}" { key => @variant_string } end |