Class: Tinker::Network::Message
- Inherits:
-
Object
- Object
- Tinker::Network::Message
- Defined in:
- lib/tinker/network/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(params) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(params) ⇒ Message
Returns a new instance of Message.
5 6 7 8 9 |
# File 'lib/tinker/network/message.rb', line 5 def initialize(params) [:socket, :body].each do |param| instance_variable_set("@#{param}", params[param]) end end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/tinker/network/message.rb', line 3 def body @body end |
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
3 4 5 |
# File 'lib/tinker/network/message.rb', line 3 def socket @socket end |