Class: Emjay::Components::MjStyle
Instance Attribute Summary
#attributes, #context, #props
Class Method Summary
collapse
Instance Method Summary
collapse
#handler_children
default_attributes, #get_attribute, #get_child_context, #get_content, #initialize, raw_element?
Class Method Details
.allowed_attributes ⇒ Object
17
18
19
|
# File 'lib/emjay/components/head/mj_style.rb', line 17
def self.allowed_attributes
{"inline" => "string"}
end
|
.component_name ⇒ Object
9
10
11
|
# File 'lib/emjay/components/head/mj_style.rb', line 9
def self.component_name
"mj-style"
end
|
.ending_tag? ⇒ Boolean
13
14
15
|
# File 'lib/emjay/components/head/mj_style.rb', line 13
def self.ending_tag?
true
end
|
Instance Method Details
#handler ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/emjay/components/head/mj_style.rb', line 21
def handler
add = @context[:add]
key = if get_attribute("inline") == "inline"
:inline_style
else
:style
end
add.call(key, get_content)
end
|