Class: Id3Taginator::Frames::Grouping::GroupIdentificationFrame
- Inherits:
-
Id3v2Frame
- Object
- Id3v2Frame
- Id3Taginator::Frames::Grouping::GroupIdentificationFrame
- Includes:
- HasId
- Defined in:
- lib/id3taginator/frames/grouping/grid_group_identification_frame.rb
Constant Summary
Constants inherited from Id3v2Frame
Id3v2Frame::HEADER_SIZE_V_2, Id3v2Frame::HEADER_SIZE_V_3_4
Constants included from Extensions::Encodable
Extensions::Encodable::ISO8859_1, Extensions::Encodable::UNICODE_ZERO, Extensions::Encodable::UTF_16, Extensions::Encodable::UTF_16BE, Extensions::Encodable::UTF_8, Extensions::Encodable::ZERO
Instance Attribute Summary collapse
-
#group_dependant_data ⇒ Object
Returns the value of attribute group_dependant_data.
-
#group_symbol ⇒ Object
Returns the value of attribute group_symbol.
-
#owner_id ⇒ Object
Returns the value of attribute owner_id.
Attributes inherited from Id3v2Frame
Class Method Summary collapse
-
.build_frame(owner_id, group_symbol, group_dependant_data, options = nil, id3_version: 3) ⇒ Id3v2Frame
builds the group identification frame.
Instance Method Summary collapse
Methods included from HasId
#frame_info, included, #supported?
Methods inherited from Id3v2Frame
build_id3_flags, build_v2_frame, build_v3_frame, build_v4_frame, #compression?, #encryption?, #file_alter_preservation?, #frame_size, #group_identity?, #initialize, #re_calc_payload_size, #read_only?, #tag_alter_preservation?, #to_bytes
Methods included from Extensions::ArgumentCheck
#argument_between_num, #argument_boolean, #argument_exactly_chars, #argument_less_than_chars, #argument_more_than_chars, #argument_not_empty, #argument_not_nil, #argument_sym, included
Methods included from Extensions::Encodable
#decode, #decode_using_encoding_byte, #default_encoding_destination_byte, #encode, #encode_and_add_encoding_byte, #encode_string, #find_encoding, #find_encoding_byte, included, #merge, #pad_left, #pad_right, #read_stream_until, #remove_trailing_zeros, #zero_byte
Constructor Details
This class inherits a constructor from Id3Taginator::Frames::Id3v2Frame
Instance Attribute Details
#group_dependant_data ⇒ Object
Returns the value of attribute group_dependant_data.
11 12 13 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 11 def group_dependant_data @group_dependant_data end |
#group_symbol ⇒ Object
Returns the value of attribute group_symbol.
11 12 13 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 11 def group_symbol @group_symbol end |
#owner_id ⇒ Object
Returns the value of attribute owner_id.
11 12 13 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 11 def owner_id @owner_id end |
Class Method Details
.build_frame(owner_id, group_symbol, group_dependant_data, options = nil, id3_version: 3) ⇒ Id3v2Frame
builds the group identification frame
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 22 def self.build_frame(owner_id, group_symbol, group_dependant_data, = nil, id3_version: 3) supported?('GRID', id3_version, ) argument_not_nil(owner_id, 'owner_id') argument_between_num(group_symbol, 'group_symbol', 0, 255) argument_not_nil(group_dependant_data, 'group_dependant_data') frame = new(frame_id(id3_version, ), 0, build_id3_flags(id3_version), '') frame.owner_id = owner_id frame.group_symbol = group_symbol frame.group_dependant_data = group_dependant_data frame end |
Instance Method Details
#content_to_bytes ⇒ Object
43 44 45 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 43 def content_to_bytes merge(@owner_id, "\x00", @group_symbol.chr, @group_dependant_data) end |
#process_content(content) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/id3taginator/frames/grouping/grid_group_identification_frame.rb', line 36 def process_content(content) stream = StringIO.new(content) @owner_id = read_stream_until(stream, ZERO) @group_symbol = stream.readbyte @group_dependant_data = stream.read end |