Class: Rack::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, params = {}) ⇒ Source

Returns a new instance of Source.



9
10
11
12
# File 'lib/rack/source.rb', line 9

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

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/rack/source.rb', line 7

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/rack/source.rb', line 7

def path
  @path
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
# File 'lib/rack/source.rb', line 14

def call(env)
  [200, { 'Content-Type' => 'text/html' }, [html]]
end