Class: QLab::Reply
- Inherits:
-
Struct
- Object
- Struct
- QLab::Reply
- Defined in:
- lib/qlab-ruby/reply.rb
Overview
QLab OSC reply unpacker.
Instance Attribute Summary collapse
-
#osc_message ⇒ Object
Returns the value of attribute osc_message.
Instance Method Summary collapse
- #address ⇒ Object
- #data ⇒ Object
- #empty? ⇒ Boolean
- #has_data? ⇒ Boolean
- #has_status? ⇒ Boolean
- #ok? ⇒ Boolean
- #status ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#osc_message ⇒ Object
Returns the value of attribute osc_message
5 6 7 |
# File 'lib/qlab-ruby/reply.rb', line 5 def end |
Instance Method Details
#address ⇒ Object
6 7 8 |
# File 'lib/qlab-ruby/reply.rb', line 6 def address @address ||= json['address'] end |
#data ⇒ Object
10 11 12 |
# File 'lib/qlab-ruby/reply.rb', line 10 def data @data ||= json['data'] end |
#empty? ⇒ Boolean
30 31 32 |
# File 'lib/qlab-ruby/reply.rb', line 30 def empty? false end |
#has_data? ⇒ Boolean
18 19 20 |
# File 'lib/qlab-ruby/reply.rb', line 18 def has_data? !data.nil? end |
#has_status? ⇒ Boolean
22 23 24 |
# File 'lib/qlab-ruby/reply.rb', line 22 def has_status? !status.nil? end |
#ok? ⇒ Boolean
26 27 28 |
# File 'lib/qlab-ruby/reply.rb', line 26 def ok? status == 'ok' end |
#status ⇒ Object
14 15 16 |
# File 'lib/qlab-ruby/reply.rb', line 14 def status @status ||= json['status'] end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/qlab-ruby/reply.rb', line 34 def to_s "<QLab::Reply address:'#{address}' status:'#{status}' data:#{data.inspect}>" end |