Class: Nephos::Controller
- Inherits:
-
Object
- Object
- Nephos::Controller
- Defined in:
- lib/nephos-server/routing/controller.rb
Instance Attribute Summary collapse
-
#callpath ⇒ Object
readonly
Returns the value of attribute callpath.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#infos ⇒ Object
readonly
Returns the value of attribute infos.
Instance Method Summary collapse
- #arguments ⇒ Object (also: #params)
-
#initialize(env = {}, parsed = {path: [], args: {}}, callpath = {params: []}) ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
#initialize(env = {}, parsed = {path: [], args: {}}, callpath = {params: []}) ⇒ Controller
Returns a new instance of Controller.
8 9 10 11 12 13 14 15 |
# File 'lib/nephos-server/routing/controller.rb', line 8 def initialize env={}, parsed={path: [], args: {}}, callpath={params: []} @env= env @infos= parsed @callpath= callpath @params= parsed[:args] @params.merge! Hash[callpath[:params].zip @infos[:path]] @params.select!{|k,v|k} end |
Instance Attribute Details
#callpath ⇒ Object (readonly)
Returns the value of attribute callpath.
4 5 6 |
# File 'lib/nephos-server/routing/controller.rb', line 4 def callpath @callpath end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/nephos-server/routing/controller.rb', line 4 def env @env end |
#infos ⇒ Object (readonly)
Returns the value of attribute infos.
4 5 6 |
# File 'lib/nephos-server/routing/controller.rb', line 4 def infos @infos end |
Instance Method Details
#arguments ⇒ Object Also known as: params
17 18 19 |
# File 'lib/nephos-server/routing/controller.rb', line 17 def arguments @params end |