Class: Super::Panel

Inherits:
Object
  • Object
show all
Includes:
Super::Partial::Resolving
Defined in:
lib/super/panel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Super::Partial::Resolving

resolve_for_rendering

Constructor Details

#initialize(*parts) ⇒ Panel

Returns a new instance of Panel.



9
10
11
12
13
14
15
# File 'lib/super/panel.rb', line 9

def initialize(*parts)
  if block_given?
    @parts = Array.new(yield)
  end

  @parts = parts
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



17
18
19
# File 'lib/super/panel.rb', line 17

def parts
  @parts
end

Instance Method Details

#resolve(template, block) ⇒ Object



19
20
21
22
# File 'lib/super/panel.rb', line 19

def resolve(template, block)
  @resolved_parts ||= resolve_for_rendering(template, parts, block)
  self
end

#resolved_partsObject



24
25
26
# File 'lib/super/panel.rb', line 24

def resolved_parts
  @resolved_parts || []
end

#to_partial_pathObject



28
29
30
# File 'lib/super/panel.rb', line 28

def to_partial_path
  "panel"
end