Class: SystemBrowser::Request
- Inherits:
-
Object
- Object
- SystemBrowser::Request
- Defined in:
- lib/system_browser/request.rb
Constant Summary collapse
- FIN =
Represents a request that ends connection.
'FIN'
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#callback_id ⇒ Object
readonly
Returns the value of attribute callback_id.
-
#other ⇒ Object
readonly
Returns the value of attribute other.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #client_pid ⇒ Object
-
#initialize(json) ⇒ Request
constructor
A new instance of Request.
- #parse ⇒ Object
- #sets_client_pid? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ Request
Returns a new instance of Request.
9 10 11 12 13 14 15 16 17 |
# File 'lib/system_browser/request.rb', line 9 def initialize(json) @req = self.get_data(json) @data = @req['system_browser_server'] @action = nil @resource = nil @scope = nil @other = nil end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/system_browser/request.rb', line 7 def action @action end |
#callback_id ⇒ Object (readonly)
Returns the value of attribute callback_id.
7 8 9 |
# File 'lib/system_browser/request.rb', line 7 def callback_id @callback_id end |
#other ⇒ Object (readonly)
Returns the value of attribute other.
7 8 9 |
# File 'lib/system_browser/request.rb', line 7 def other @other end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/system_browser/request.rb', line 7 def resource @resource end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/system_browser/request.rb', line 7 def scope @scope end |
Instance Method Details
#client_pid ⇒ Object
33 34 35 |
# File 'lib/system_browser/request.rb', line 33 def client_pid @resource end |
#parse ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/system_browser/request.rb', line 19 def parse @callback_id = @req['callbackId'] @action = @data['action'] @resource = @data['resource'] @scope = @data['scope'] @other = @data['other'] end |
#sets_client_pid? ⇒ Boolean
29 30 31 |
# File 'lib/system_browser/request.rb', line 29 def sets_client_pid? @action == Client::PID_COMMAND end |