Class: Anobik::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/anobik/utils.rb

Instance Method Summary collapse

Constructor Details

#initializeResource

Returns a new instance of Resource.



6
7
8
9
10
# File 'lib/anobik/utils.rb', line 6

def initialize
  @anobik_env = yield
  @request = Rack::Request.new(@anobik_env)
  @response = Rack::Request.new(@anobik_env)
end

Instance Method Details

#render(facename, local_assigns = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/anobik/utils.rb', line 12

def render facename, local_assigns = {}
  local_assigns.each do |key,value|
   eval "@#{key} = #{value.inspect}"
  end
  ERB.new(File.read(ANOBIK_ROOT + ::Anobik::FACES_DIR + facename + '.erb')).result(binding)
end