Class: MTP::ParametersContainer
- Defined in:
- lib/mtp/container.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
Attributes inherited from Container
#code, #length, #length_read, #payload, #transaction_id
Instance Method Summary collapse
-
#initialize ⇒ ParametersContainer
constructor
A new instance of ParametersContainer.
- #pack_payload ⇒ Object
- #payload=(payload) ⇒ Object
Methods inherited from Container
#pack, #pack_header, parse, #to_s, #type
Constructor Details
#initialize ⇒ ParametersContainer
Returns a new instance of ParametersContainer.
54 55 56 57 |
# File 'lib/mtp/container.rb', line 54 def initialize super @parameters = [] end |
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
53 54 55 |
# File 'lib/mtp/container.rb', line 53 def parameters @parameters end |
Instance Method Details
#pack_payload ⇒ Object
59 60 61 |
# File 'lib/mtp/container.rb', line 59 def pack_payload @parameters.pack_without_mtp("I*") end |
#payload=(payload) ⇒ Object
63 64 65 66 |
# File 'lib/mtp/container.rb', line 63 def payload=(payload) @payload = payload @parameters = payload.unpack("I*") end |