Class: Roby::Interface::V2::Protocol::TaskEvent
- Defined in:
- lib/roby/interface/v2/protocol.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#generator ⇒ Object
Returns the value of attribute generator.
-
#propagation_id ⇒ Object
Returns the value of attribute propagation_id.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context
114 115 116 |
# File 'lib/roby/interface/v2/protocol.rb', line 114 def context @context end |
#generator ⇒ Object
Returns the value of attribute generator
114 115 116 |
# File 'lib/roby/interface/v2/protocol.rb', line 114 def generator @generator end |
#propagation_id ⇒ Object
Returns the value of attribute propagation_id
114 115 116 |
# File 'lib/roby/interface/v2/protocol.rb', line 114 def propagation_id @propagation_id end |
#time ⇒ Object
Returns the value of attribute time
114 115 116 |
# File 'lib/roby/interface/v2/protocol.rb', line 114 def time @time end |
Instance Method Details
#pp_context(pp) ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/roby/interface/v2/protocol.rb', line 131 def pp_context(pp) if !context || context.empty? pp.text "No context" return end pp.text "context:" context.each do |obj| pp.nest(2) do pp.breakable obj.pretty_print(pp) end end end |
#pretty_print(pp) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/roby/interface/v2/protocol.rb', line 117 def pretty_print(pp) time_s = Roby.format_time(time) pp.text "event '#{generator.symbol}' emitted at [#{time_s} " \ "@#{propagation_id}] from" pp.nest(2) do pp.breakable generator.task.pretty_print(pp) end pp.nest(2) do pp.breakable pp_context(pp) end end |
#to_s ⇒ Object
146 147 148 149 |
# File 'lib/roby/interface/v2/protocol.rb', line 146 def to_s time_s = Roby.format_time(time) "[#{time_s} @#{propagation_id}] #{generator}: #{context}" end |