Module: S2P::Component::SinatraRenderer
- Defined in:
- lib/s2p/component.rb
Overview
WARNING: Probably not fully functional but it does work for the most basic use cases for components.
Defined Under Namespace
Modules: Helpers
Class Method Summary collapse
- .app ⇒ Object
- .helpers ⇒ Object
- .render(template = nil, inline: nil, locals: {}, layout: false) ⇒ Object
Class Method Details
.app ⇒ Object
78 79 80 |
# File 'lib/s2p/component.rb', line 78 def self.app @app ||= Sinatra::Application.new.instance_variable_get :@instance end |
.helpers ⇒ Object
74 75 76 |
# File 'lib/s2p/component.rb', line 74 def self.helpers Helpers end |
.render(template = nil, inline: nil, locals: {}, layout: false) ⇒ Object
82 83 84 |
# File 'lib/s2p/component.rb', line 82 def self.render(template=nil, inline: nil, locals: {}, layout: false) app.erb(inline, locals:, layout:) end |