Class: Radiodan::MPD::Ack

Inherits:
Object
  • Object
show all
Defined in:
lib/radiodan/adapter/mpd/ack.rb

Constant Summary collapse

FORMAT =
/ACK \[(\d)+@(\d)+\] \{(.*)\} (.*)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ack) ⇒ Ack

Returns a new instance of Ack.



6
7
8
9
# File 'lib/radiodan/adapter/mpd/ack.rb', line 6

def initialize(ack)
  matches = FORMAT.match(ack)
  @error_id, @position, @command, @description = *matches[1..-1]
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



4
5
6
# File 'lib/radiodan/adapter/mpd/ack.rb', line 4

def command
  @command
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/radiodan/adapter/mpd/ack.rb', line 4

def description
  @description
end

#error_idObject (readonly)

Returns the value of attribute error_id.



4
5
6
# File 'lib/radiodan/adapter/mpd/ack.rb', line 4

def error_id
  @error_id
end

#positionObject (readonly)

Returns the value of attribute position.



4
5
6
# File 'lib/radiodan/adapter/mpd/ack.rb', line 4

def position
  @position
end