Class: JSTP::Controller
- Inherits:
-
Object
- Object
- JSTP::Controller
- Defined in:
- lib/jstp/controller.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#referer ⇒ Object
readonly
Returns the value of attribute referer.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#dispatch(*args) ⇒ Object
Since it delegates Reader::Dispatch, the method is.
-
#initialize(original, query, engine, client = nil) ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
#initialize(original, query, engine, client = nil) ⇒ Controller
Returns a new instance of Controller.
5 6 7 8 9 10 11 12 13 |
# File 'lib/jstp/controller.rb', line 5 def initialize original, query, engine, client = nil @original = original @engine = engine @query = query @client = client unless client.nil? Configuration.instance.logger.info original.to.short end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def body @body end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def client @client end |
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def engine @engine end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def method @method end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def original @original end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def protocol @protocol end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def query @query end |
#referer ⇒ Object (readonly)
Returns the value of attribute referer.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def referer @referer end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def resource @resource end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def @timestamp end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/jstp/controller.rb', line 3 def token @token end |
Instance Method Details
#dispatch(*args) ⇒ Object
Since it delegates Reader::Dispatch, the method is
20 21 22 23 24 25 26 |
# File 'lib/jstp/controller.rb', line 20 def dispatch *args @dispatch = Dispatch.new @original @dispatch.referer = [Configuration.instance.hostname] + (self.class.to_s.split("::") - engine.class.to_s.split("::")) @dispatch.from.array args @dispatch end |