Class: MTProto::Transport::Packet
- Inherits:
-
Object
- Object
- MTProto::Transport::Packet
- Defined in:
- lib/mtproto/transport/packet.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Packet
constructor
A new instance of Packet.
- #size ⇒ Object
Constructor Details
#initialize(data) ⇒ Packet
Returns a new instance of Packet.
8 9 10 11 12 |
# File 'lib/mtproto/transport/packet.rb', line 8 def initialize(data) raise ArgumentError, 'data must be an Array' unless data.is_a?(Array) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/mtproto/transport/packet.rb', line 6 def data @data end |
Instance Method Details
#size ⇒ Object
14 15 16 |
# File 'lib/mtproto/transport/packet.rb', line 14 def size data.length end |