Class: Orchestrator::Subscription

Inherits:
Struct
  • Object
show all
Defined in:
lib/orchestrator/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Subscription

Returns a new instance of Subscription.



6
7
8
9
10
# File 'lib/orchestrator/status.rb', line 6

def initialize(*args)
    super(*args)

    @do_callback = method(:do_callback)
end

Instance Attribute Details

#callbackObject

Returns the value of attribute callback

Returns:

  • (Object)

    the current value of callback



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def callback
  @callback
end

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def index
  @index
end

#mod_idObject

Returns the value of attribute mod_id

Returns:

  • (Object)

    the current value of mod_id



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def mod_id
  @mod_id
end

#mod_nameObject

Returns the value of attribute mod_name

Returns:

  • (Object)

    the current value of mod_name



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def mod_name
  @mod_name
end

#on_threadObject

Returns the value of attribute on_thread

Returns:

  • (Object)

    the current value of on_thread



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def on_thread
  @on_thread
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def status
  @status
end

#sys_idObject

Returns the value of attribute sys_id

Returns:

  • (Object)

    the current value of sys_id



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def sys_id
  @sys_id
end

#sys_nameObject

Returns the value of attribute sys_name

Returns:

  • (Object)

    the current value of sys_name



5
6
7
# File 'lib/orchestrator/status.rb', line 5

def sys_name
  @sys_name
end

Instance Method Details

#notify(update) ⇒ Object



12
13
14
15
16
17
# File 'lib/orchestrator/status.rb', line 12

def notify(update)
    if update != @last_update
        @last_update = update
        on_thread.schedule @do_callback
    end
end

#valueObject



19
20
21
# File 'lib/orchestrator/status.rb', line 19

def value
    @last_update
end