Class: HasHelpers::Container

Inherits:
Object
  • Object
show all
Includes:
Attributes, UIAttributes
Defined in:
lib/has_helpers/utils/container.rb

Instance Attribute Summary collapse

Attributes included from UIAttributes::HTMLAttributes

#data, #skin

Instance Method Summary collapse

Methods included from Attributes::GuardedAttributes

included

Methods included from UIAttributes::HTMLAttributes

#raw_html_attrs

Methods included from Attributes

included

Instance Attribute Details

#renderableObject



29
30
31
# File 'lib/has_helpers/utils/container.rb', line 29

def renderable
  @renderable && @renderable.to_renderable
end

#tagObject



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?

Returns:

  • (Boolean)


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_pathObject



25
26
27
# File 'lib/has_helpers/utils/container.rb', line 25

def to_partial_path
  "/has_helpers/containers/#{ template }"
end

#to_renderableObject



21
22
23
# File 'lib/has_helpers/utils/container.rb', line 21

def to_renderable
  self
end