Class: TTK::Monitors::Client
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/ttk/monitors/Client.rb
Instance Attribute Summary collapse
-
#monitor ⇒ Object
readonly
Returns the value of attribute monitor.
Instance Method Summary collapse
-
#initialize(service, monitor) ⇒ Client
constructor
A new instance of Client.
- #update(service, type, time, *args, &block) ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(service, monitor) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 |
# File 'lib/ttk/monitors/Client.rb', line 14 def initialize(service, monitor) @service = service @monitor = monitor @monitor.add_observer(self) end |
Instance Attribute Details
#monitor ⇒ Object (readonly)
Returns the value of attribute monitor.
20 21 22 |
# File 'lib/ttk/monitors/Client.rb', line 20 def monitor @monitor end |
Instance Method Details
#update(service, type, time, *args, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ttk/monitors/Client.rb', line 26 def update(service, type, time, *args, &block) puts " - service: #{service}" puts " type: #{type}" puts " time: #{time}" begin contents = pp_contents(type, *args) rescue contents = $!.long_pp end puts " contents: \"#{contents}\"" end |
#uri ⇒ Object
22 23 24 |
# File 'lib/ttk/monitors/Client.rb', line 22 def uri @service.uri end |