Class: DACPClient::TagDefinition
- Inherits:
-
Struct
- Object
- Struct
- DACPClient::TagDefinition
- Defined in:
- lib/dacpclient/tag_definition.rb,
lib/dacpclient/tag_definitions.rb
Overview
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
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
6 7 8 |
# File 'lib/dacpclient/tag_definition.rb', line 6 def name @name end |
#tag ⇒ Object
Returns the value of attribute tag
6 7 8 |
# File 'lib/dacpclient/tag_definition.rb', line 6 def tag @tag end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/dacpclient/tag_definition.rb', line 6 def type @type end |
Class Method Details
.find(key) ⇒ Object Also known as: []
16 17 18 |
# File 'lib/dacpclient/tag_definition.rb', line 16 def find(key) @@tags[key.to_s] end |
.tag(*args, &block) ⇒ Object
20 21 22 23 24 |
# File 'lib/dacpclient/tag_definition.rb', line 20 def tag(*args, &block) @@tags ||= Hash.new(nil) definition = new(*args, &block).freeze @@tags[definition.tag.to_s] = definition end |
Instance Method Details
#inspect ⇒ Object
7 8 9 |
# File 'lib/dacpclient/tag_definition.rb', line 7 def inspect "#{tag} (#{name}: #{type})" end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/dacpclient/tag_definition.rb', line 11 def to_s "#{tag} (#{name}: #{type})" end |