Class: Trestle::ContainerHelper::Context

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/trestle/container_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ Context

Returns a new instance of Context.



14
15
16
# File 'app/helpers/trestle/container_helper.rb', line 14

def initialize(template)
  @template = template
end

Instance Method Details

#default_sidebar_optionsObject



27
28
29
# File 'app/helpers/trestle/container_helper.rb', line 27

def default_sidebar_options
  Trestle::Options.new(class: ["main-content-sidebar"])
end


18
19
20
21
22
23
24
25
# File 'app/helpers/trestle/container_helper.rb', line 18

def sidebar(options={}, &block)
  if block_given?
    @sidebar = @template.(:aside, default_sidebar_options.merge(options), &block)
    nil
  else
    @sidebar
  end
end