Class: Aureus::Components::Listing

Inherits:
Renderable show all
Defined in:
lib/aureus/components/listing.rb

Instance Method Summary collapse

Methods inherited from Renderable

#compact, #compact_render, #content_tag, #init

Constructor Details

#initializeListing

Returns a new instance of Listing.



7
8
9
# File 'lib/aureus/components/listing.rb', line 7

def initialize
  @entries = Array.new
end

Instance Method Details

#entry(head, body = nil, &block) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/aureus/components/listing.rb', line 11

def entry head, body = nil, &block
  init_haml_helpers
  if block_given?
    @entries << ListingEntry.new(head,capture_haml(&block))
  else
    @entries << ListingEntry.new(head,body)
  end
end

#renderObject



20
21
22
# File 'lib/aureus/components/listing.rb', line 20

def render
   'table', compact_render(*@entries), class: 'simple-table'
end