Class: ALSA::Aconnect::Client
- Inherits:
-
Object
- Object
- ALSA::Aconnect::Client
- Defined in:
- lib/alsa/aconnect/client.rb
Constant Summary collapse
- DIRECTIONS =
[:input, :output].freeze
Instance Attribute Summary collapse
-
#card ⇒ Object
readonly
Returns the value of attribute card.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(text, direction) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(text, direction) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/alsa/aconnect/client.rb', line 10 def initialize(text, direction) raise ArgumentError, "invalid direction #{direction.inspect}" unless DIRECTIONS.include?(direction) @direction = direction data = Parser.parse_client(text) @id = data[:id] @name = data[:name] @type = data[:type] @card = data[:card] @pid = data[:pid] @ports = data[:ports].map do |port_text| Port.new(port_text, self) end end |
Instance Attribute Details
#card ⇒ Object (readonly)
Returns the value of attribute card.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def card @card end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def direction @direction end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def name @name end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def pid @pid end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def ports @ports end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/alsa/aconnect/client.rb', line 8 def type @type end |