Class: ML_ruby::ML_list
- Inherits:
-
Object
- Object
- ML_ruby::ML_list
- Defined in:
- lib/ml-ruby/ml_data_types.rb
Direct Known Subclasses
ML_list_of_availability, ML_list_of_comment, ML_list_of_fileinfo, ML_list_of_int16, ML_list_of_int32, ML_list_of_ogg_stream, ML_list_of_ogg_stream_tags, ML_list_of_string, ML_list_of_subfile, ML_string
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #encode ⇒ Object
-
#initialize(payload) ⇒ ML_list
constructor
A new instance of ML_list.
- #size ⇒ Object
Constructor Details
#initialize(payload) ⇒ ML_list
Returns a new instance of ML_list.
58 59 60 |
# File 'lib/ml-ruby/ml_data_types.rb', line 58 def initialize payload @payload= payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
57 58 59 |
# File 'lib/ml-ruby/ml_data_types.rb', line 57 def payload @payload end |
Class Method Details
.decode(data) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/ml-ruby/ml_data_types.rb', line 67 def self.decode data # puts self.name, data.inspect len= ML_int16.decode data data= data[len.size..-1] result=[] len.payload.times do elem= @type.decode( data ) # puts self.name, elem.to_yaml result<< elem data= data[elem.size..-1] end self.new result end |
Instance Method Details
#==(other) ⇒ Object
80 81 82 83 |
# File 'lib/ml-ruby/ml_data_types.rb', line 80 def == other false unless other payload == other.payload end |