Class: Rack::Source
- Inherits:
-
Object
- Object
- Rack::Source
- Defined in:
- lib/rack/source.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(path, params = {}) ⇒ Source
constructor
A new instance of Source.
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
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/rack/source.rb', line 7 def params @params end |
#path ⇒ Object (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 |