Class: Chaplin::Responses::Page
- Inherits:
-
Struct
- Object
- Struct
- Chaplin::Responses::Page
- Defined in:
- lib/chaplin/responses/page.rb
Overview
data is a hash with symbols as keys and api endpoints or other pages as values
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#template_path ⇒ Object
Returns the value of attribute template_path.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
7 8 9 |
# File 'lib/chaplin/responses/page.rb', line 7 def data @data end |
#template_path ⇒ Object
Returns the value of attribute template_path
7 8 9 |
# File 'lib/chaplin/responses/page.rb', line 7 def template_path @template_path end |
Instance Method Details
#execute(request_params, sinatra_server) ⇒ Object
9 10 11 |
# File 'lib/chaplin/responses/page.rb', line 9 def execute(request_params, sinatra_server) render(request_params) end |
#render(request_params) ⇒ Object
13 14 15 16 17 |
# File 'lib/chaplin/responses/page.rb', line 13 def render(request_params) page = Mustache.new page.template_file = template_path page.render(rendered_data(request_params).merge({params: request_params})) end |