Class: DMAPParser::TagDefinition
- Inherits:
-
Struct
- Object
- Struct
- DMAPParser::TagDefinition
- Defined in:
- lib/dmapparser/tag_definition.rb,
lib/dmapparser/tag_definitions.rb
Overview
Sources: github.com/chendo/dmap-ng/blob/master/lib/dmap/tag_definitions.rb code.google.com/p/ytrack/wiki/DMAP code.google.com/p/tunesremote-se/wiki/ContentCodes raw.github.com/mattstevens/dmap-parser/master/dmap_parser.c /content-codes rubocop:disable ClassLength
Constant Summary collapse
- DEFINITIONS =
Hash.new(nil)
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
- .find(key) ⇒ Object (also: [])
- .tag(*args, &block) ⇒ Object
Instance Method Summary collapse
- #container? ⇒ Boolean
- #to_s ⇒ Object (also: #inspect)
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
6 7 8 |
# File 'lib/dmapparser/tag_definition.rb', line 6 def name @name end |
#tag ⇒ Object
Returns the value of attribute tag
6 7 8 |
# File 'lib/dmapparser/tag_definition.rb', line 6 def tag @tag end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/dmapparser/tag_definition.rb', line 6 def type @type end |
Class Method Details
.find(key) ⇒ Object Also known as: []
20 21 22 |
# File 'lib/dmapparser/tag_definition.rb', line 20 def find(key) DEFINITIONS[key.to_s] end |
.tag(*args, &block) ⇒ Object
24 25 26 27 |
# File 'lib/dmapparser/tag_definition.rb', line 24 def tag(*args, &block) definition = new(*args, &block).freeze DEFINITIONS[definition.tag.to_s] = definition end |
Instance Method Details
#container? ⇒ Boolean
15 16 17 |
# File 'lib/dmapparser/tag_definition.rb', line 15 def container? type == :container end |
#to_s ⇒ Object Also known as: inspect
9 10 11 |
# File 'lib/dmapparser/tag_definition.rb', line 9 def to_s "#{tag} (#{name}: #{type})" end |