Class: Bridgetown::Tags::ClassMap
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Bridgetown::Tags::ClassMap
- Defined in:
- bridgetown-core/lib/bridgetown-core/tags/class_map.rb
Overview
A ClassMap class is meant to take a hash and append styles based on if the value is truthy or falsy
Constant Summary collapse
- FALSE_VALUES =
[ nil, "nil", "NIL", false, 0, "0", :"0", "f", :f, "F", :F, "false", false, "FALSE", :FALSE, ].to_set.freeze
Instance Method Summary collapse
-
#initialize(tag_name, input, tokens) ⇒ ClassMap
constructor
Returns a ClassMap object.
-
#render(context) ⇒ Object
Constructor Details
#initialize(tag_name, input, tokens) ⇒ ClassMap
Returns a ClassMap object
36 37 38 39 |
# File 'bridgetown-core/lib/bridgetown-core/tags/class_map.rb', line 36 def initialize(tag_name, input, tokens) super @input = input end |
Instance Method Details
#render(context) ⇒ Object
41 42 43 |
# File 'bridgetown-core/lib/bridgetown-core/tags/class_map.rb', line 41 def render(context) class_map(@input, context) end |