Class: HasHelpers::Container
- Inherits:
-
Object
- Object
- HasHelpers::Container
- Includes:
- Attributes, UIAttributes
- Defined in:
- lib/has_helpers/utils/container.rb
Instance Attribute Summary collapse
Attributes included from UIAttributes::HTMLAttributes
Instance Method Summary collapse
- #any? ⇒ Boolean (also: #present?)
- #to_container(**attrs) ⇒ Object
- #to_partial_path ⇒ Object
- #to_renderable ⇒ Object
Methods included from Attributes::GuardedAttributes
Methods included from UIAttributes::HTMLAttributes
Methods included from Attributes
Instance Attribute Details
#renderable ⇒ Object
29 30 31 |
# File 'lib/has_helpers/utils/container.rb', line 29 def renderable @renderable && @renderable.to_renderable end |
#tag ⇒ Object
12 13 14 |
# File 'lib/has_helpers/utils/container.rb', line 12 def tag @tag ||= :div end |
Instance Method Details
#any? ⇒ Boolean Also known as: present?
33 34 35 |
# File 'lib/has_helpers/utils/container.rb', line 33 def any? renderable.try(:any?) end |
#to_container(**attrs) ⇒ Object
16 17 18 19 |
# File 'lib/has_helpers/utils/container.rb', line 16 def to_container(**attrs) assign_attributes(attrs) self end |
#to_partial_path ⇒ Object
25 26 27 |
# File 'lib/has_helpers/utils/container.rb', line 25 def to_partial_path "/has_helpers/containers/#{ template }" end |
#to_renderable ⇒ Object
21 22 23 |
# File 'lib/has_helpers/utils/container.rb', line 21 def to_renderable self end |