Class: Referee::TemplateRenderer
- Inherits:
-
Object
- Object
- Referee::TemplateRenderer
- Defined in:
- lib/referee/templaterenderer.rb
Overview
Manages finding and rendering code templates to strings.
Constant Summary collapse
- INTERFACE_TEMPLATE_NAME =
'interface.h'- IMPLEMENTATION_TEMPLATE_NAME =
'implementation.m'- SWIFT_TEMPLATE_NAME =
'default.swift'
Instance Method Summary collapse
-
#render_implementation(dict) ⇒ Object
Renders the implementation (.m) file as a string.
-
#render_interface(dict) ⇒ Object
Renders the interface (.h) file as a string.
-
#render_swift_implementation(dict) ⇒ Object
Renders the Swift implementation file as a string.
Instance Method Details
#render_implementation(dict) ⇒ Object
Renders the implementation (.m) file as a string.
24 25 26 |
# File 'lib/referee/templaterenderer.rb', line 24 def render_implementation(dict) template(IMPLEMENTATION_TEMPLATE_NAME).call(dict) end |
#render_interface(dict) ⇒ Object
Renders the interface (.h) file as a string.
29 30 31 |
# File 'lib/referee/templaterenderer.rb', line 29 def render_interface(dict) template(INTERFACE_TEMPLATE_NAME).call(dict) end |
#render_swift_implementation(dict) ⇒ Object
Renders the Swift implementation file as a string.
34 35 36 |
# File 'lib/referee/templaterenderer.rb', line 34 def render_swift_implementation(dict) template(SWIFT_TEMPLATE_NAME).call(dict) end |