Class: Modular::LayoutGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/modular/layout_generator.rb

Defined Under Namespace

Classes: ERBContext

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, params = {}) ⇒ LayoutGenerator

Returns a new instance of LayoutGenerator.



26
27
28
29
# File 'lib/modular/layout_generator.rb', line 26

def initialize(id, params= {})
  @id = id
  @params = params
end

Class Method Details

.generate(id, params = {}) ⇒ Object



17
18
19
# File 'lib/modular/layout_generator.rb', line 17

def self.generate(id, params = {})
  new(id, params).generate
end

Instance Method Details

#generateObject



21
22
23
24
# File 'lib/modular/layout_generator.rb', line 21

def generate
  write_layout unless layout_exists?
  filename.to_s
end