Class: Rapidomize::Message
- Inherits:
-
Object
- Object
- Rapidomize::Message
- Defined in:
- lib/rapidomize/message.rb
Overview
Message objects are at the core of SDK. Each message is an independent entity with following information
- uri
-
A message must have a URI, which is the destination of the message.
- payload
-
_(optional)_ A message may contain a Payload to transmit data
- token
-
_(optional)_ token for authorization purposes
- app_id
-
_(optional)_ app_id of the receiving ICAPP
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, payload = nil, token = nil, app_id = nil) ⇒ Message
constructor
Initialize a message object.
Constructor Details
#initialize(uri, payload = nil, token = nil, app_id = nil) ⇒ Message
Initialize a message object
19 20 21 22 23 24 25 26 |
# File 'lib/rapidomize/message.rb', line 19 def initialize(uri, payload = nil, token = nil, app_id = nil) raise ArgumentError, 'uri is nil' if uri.nil? @payload = Payload.create(payload) @uri = sanitize_uri(uri) @app_id = app_id @token = token end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
12 13 14 |
# File 'lib/rapidomize/message.rb', line 12 def app_id @app_id end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
12 13 14 |
# File 'lib/rapidomize/message.rb', line 12 def payload @payload end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
12 13 14 |
# File 'lib/rapidomize/message.rb', line 12 def token @token end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
12 13 14 |
# File 'lib/rapidomize/message.rb', line 12 def uri @uri end |