Module: Bureau::InstanceMethods

Defined in:
lib/bureau.rb

Instance Method Summary collapse

Instance Method Details

#helpObject



62
63
64
65
# File 'lib/bureau.rb', line 62

def help
  @content = _t('help.html')
  _finish
end

#list(m) ⇒ Object



48
# File 'lib/bureau.rb', line 48

def list(m); @content = Kernel.const_get(m).list_view(@r); _finish; end

def edit(m,id); @content = eval(m).backend_form(_config‘/’m‘/’id); _finish; end



51
52
53
54
55
56
57
58
59
60
# File 'lib/bureau.rb', line 51

def submenu(group,section)
  title, *links = _config[:menu][group.to_i][section.to_i]
  @content = "<h2 class='slide-title'><span>#{title}</span></h2>"
  @content << "<ul class='submenu-list'>\n"
  until links.empty?
    @content << "<li><a class='push-stack' href='#{links.shift}'>#{links.shift}</a></li>\n"
  end
  @content << "</ul>\n"
  _finish
end

#wrap_api_responseObject



67
68
69
70
71
72
73
# File 'lib/bureau.rb', line 67

def wrap_api_response
  status, header, body = @app.call(@r.env)
  @res.status = status
  @res.header.replace(header)
  @content = body.inject(''){|r,s| r+s }
  _with_layout
end