module Flow::Operation::Accessors::ClassMethods

Protected Instance Methods

state_accessor(*names, prefix: false) click to toggle source
# File lib/flow/operation/accessors.rb, line 35
def state_accessor(*names, prefix: false)
  names.each do |name|
    state_reader name, prefix: prefix
    state_writer name, prefix: prefix
  end
end
state_reader(*names, prefix: false) click to toggle source
# File lib/flow/operation/accessors.rb, line 19
def state_reader(*names, prefix: false)
  names.each do |name|
    delegate name, prefix: prefix, to: :state

    _add_state_reader_tracker(name.to_sym)
  end
end
state_writer(*names, prefix: false) click to toggle source
# File lib/flow/operation/accessors.rb, line 27
def state_writer(*names, prefix: false)
  names.each do |name|
    delegate "#{name}=", prefix: prefix, to: :state

    _add_state_writer_tracker(name.to_sym)
  end
end

Private Instance Methods

_add_state_reader_tracker(name) click to toggle source
# File lib/flow/operation/accessors.rb, line 44
def _add_state_reader_tracker(name)
  _state_accessors << name if _state_writers.include?(name)
  _state_readers << name
end
_add_state_writer_tracker(name) click to toggle source
# File lib/flow/operation/accessors.rb, line 49
def _add_state_writer_tracker(name)
  _state_accessors << name if _state_readers.include?(name)
  _state_writers << name
end
inherited(base) click to toggle source
Calls superclass method
# File lib/flow/operation/accessors.rb, line 54
def inherited(base)
  base._state_readers = _state_readers.dup
  base._state_writers = _state_writers.dup
  base._state_accessors = _state_accessors.dup

  super
end