Class: Tailwindcss::Style
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Tailwindcss::Style
- Defined in:
- lib/tailwindcss/style.rb
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Style
constructor
A new instance of Style.
- #to_a ⇒ Object
- #to_html_attributes ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Style
Returns a new instance of Style.
6 7 8 9 |
# File 'lib/tailwindcss/style.rb', line 6 def initialize(attributes = {}) super @attributes = attributes end |
Instance Method Details
#to_a ⇒ Object
11 12 13 |
# File 'lib/tailwindcss/style.rb', line 11 def to_a to_string_converter.call(**@attributes) end |
#to_html_attributes ⇒ Object
19 20 21 |
# File 'lib/tailwindcss/style.rb', line 19 def to_html_attributes {class: to_s} end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/tailwindcss/style.rb', line 15 def to_s to_a.join(" ") end |