Class: Tailwindcss::Style

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/tailwindcss/style.rb

Instance Method Summary collapse

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_aObject



11
12
13
# File 'lib/tailwindcss/style.rb', line 11

def to_a
  to_string_converter.call(**@attributes)
end

#to_html_attributesObject



19
20
21
# File 'lib/tailwindcss/style.rb', line 19

def to_html_attributes
  {class: to_s}
end

#to_sObject



15
16
17
# File 'lib/tailwindcss/style.rb', line 15

def to_s
  to_a.join(" ")
end