Class: RubyView::Context

Inherits:
Object
  • Object
show all
Includes:
DSL, Helpers::Tag
Defined in:
lib/rubyview/context.rb

Instance Method Summary collapse

Methods included from Helpers::Tag

#format_html_opts, #generate_tag, #h1

Methods included from DSL

#header

Constructor Details

#initializeContext

Returns a new instance of Context.



7
8
# File 'lib/rubyview/context.rb', line 7

def initialize
end

Instance Method Details

#call(path_to_template) ⇒ Object



10
11
12
13
14
15
# File 'lib/rubyview/context.rb', line 10

def call(path_to_template)
  @_rendered_content = ""
  template_path = File.join(Dir.pwd, path_to_template)
  template_content = File.read(template_path)
  instance_eval(template_content)
end