Class: Erubis::Context

Class | Erubis::Context
In: | lib/erubis/context.rb
Parent: | Object

context object for Engine#evaluate

ex.

      template = <<'END'
      Hello <%= @user %>!
      <% for item in @list %>
       - <%= item %>
      <% end %>
      END

      context = Erubis::Context.new(:user=>'World', :list=>['a','b','c'])
      # or
      # context = Erubis::Context.new
      # context[:user] = 'World'
      # context[:list] = ['a', 'b', 'c']

      eruby = Erubis::Eruby.new(template)
      print eruby.evaluate(context)

### Methods

[] []= each keys new to_hash update

### Included Modules

Enumerable

### Public Class methods

new(hash=nil)

### Public Instance methods

[](key)
[]=(key, value)
each() {|key, value| ...}
keys()
to_hash()
update(context_or_hash)

[Validate]