Class: Emjay::Components::MjBreakpoint

Inherits:
HeadComponent show all
Defined in:
lib/emjay/components/head/mj_breakpoint.rb

Instance Attribute Summary

Attributes inherited from Emjay::Component

#attributes, #context, #props

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HeadComponent

#handler_children

Methods inherited from Emjay::Component

default_attributes, #get_attribute, #get_child_context, #get_content, #initialize, raw_element?

Constructor Details

This class inherits a constructor from Emjay::Component

Class Method Details

.allowed_attributesObject



17
18
19
# File 'lib/emjay/components/head/mj_breakpoint.rb', line 17

def self.allowed_attributes
  {"width" => "unit(px)"}
end

.component_nameObject



9
10
11
# File 'lib/emjay/components/head/mj_breakpoint.rb', line 9

def self.component_name
  "mj-breakpoint"
end

.ending_tag?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/emjay/components/head/mj_breakpoint.rb', line 13

def self.ending_tag?
  true
end

Instance Method Details

#handlerObject



21
22
23
# File 'lib/emjay/components/head/mj_breakpoint.rb', line 21

def handler
  @context[:add].call(:breakpoint, get_attribute("width"))
end