Class: Macrocosm::Template
- Inherits:
-
Object
- Object
- Macrocosm::Template
- Defined in:
- lib/macrocosm/template.rb
Defined Under Namespace
Classes: Position
Constant Summary collapse
- Raw =
File.read(File.join(__dir__, 'template.html'))
- Positions =
[]
- Engine =
ERB.new(Positions.reduce(Raw){ |file, pos| file.sub(pos.regexp, pos.mark) })
- Css =
'<style>' + File.read(File.join(__dir__, 'frontend', 'iview.4.3.2.css')) + '</style>'
- Js =
['vue.2.6.12.min.js', 'iview.min.js', 'echarts.4.8.0.2.min.js', 'vue-echarts.4.0.2.min.js'].each_with_object([]) do |file, arr| code = File.read(File.join(__dir__, 'frontend', file)) arr << '<script>' << code << '</script>' end.join
Instance Attribute Summary collapse
-
#binding_values ⇒ Object
readonly
Returns the value of attribute binding_values.
Instance Method Summary collapse
-
#initialize(binding_values) ⇒ Template
constructor
A new instance of Template.
- #render ⇒ Object
Constructor Details
Instance Attribute Details
#binding_values ⇒ Object (readonly)
Returns the value of attribute binding_values.
50 51 52 |
# File 'lib/macrocosm/template.rb', line 50 def binding_values @binding_values end |
Instance Method Details
#render ⇒ Object
56 57 58 |
# File 'lib/macrocosm/template.rb', line 56 def render Engine.result(binding) end |