Class: Getto::Elm::Layout::Router::Drawer
- Inherits:
-
Object
- Object
- Getto::Elm::Layout::Router::Drawer
- Defined in:
- lib/getto/elm/layout/router/drawer.rb
Instance Method Summary collapse
- #build(&block) ⇒ Object
- #draw(&block) ⇒ Object
-
#initialize(output_file, app = {}) ⇒ Drawer
constructor
A new instance of Drawer.
Constructor Details
#initialize(output_file, app = {}) ⇒ Drawer
Returns a new instance of Drawer.
5 6 7 8 |
# File 'lib/getto/elm/layout/router/drawer.rb', line 5 def initialize(output_file,app={}) @output_file = output_file @app = app end |
Instance Method Details
#build(&block) ⇒ Object
13 14 15 |
# File 'lib/getto/elm/layout/router/drawer.rb', line 13 def build(&block) Container.new([],@app).instance_exec(&block) end |
#draw(&block) ⇒ Object
10 11 12 |
# File 'lib/getto/elm/layout/router/drawer.rb', line 10 def draw(&block) File.write @output_file, JSON.generate(build(&block)) end |