lib/flor/unit/taskers.rb
def derive_message(m)

      exid = m['exid']
      nid = m['nid']
      pl = m['payload']

      return m if Flor.is_exid?(exid) && Flor.is_nid?(nid) && pl.is_a?(Hash)

      m = Flor.to_string_keyed_hash(m)
      h = Flor.dup(@message)
      ks = m.keys

      if ks == [ 'payload' ]

        h['payload'] = m['payload']

      elsif (ks & %w[ ret set unset ]).size > 0

        pl = (h['payload'] ||= {})

        pl['ret'] = m['ret'] if m.has_key?('ret')
        (m['set'] || {}).each { |k, v| pl[k] = v }
        (m['unset'] || []).each { |k| pl.delete(k.to_s) }

      else

        h['payload'] = m
      end

      h
    end
def derive_message(m)

      exid = m['exid']
      nid = m['nid']
      pl = m['payload']

      return m if Flor.is_exid?(exid) && Flor.is_nid?(nid) && pl.is_a?(Hash)

      m = Flor.to_string_keyed_hash(m)
      h = Flor.dup(@message)
      ks = m.keys

      if ks == [ 'payload' ]

        h['payload'] = m['payload']

      elsif (ks & %w[ ret set unset ]).size > 0

        pl = (h['payload'] ||= {})

        pl['ret'] = m['ret'] if m.has_key?('ret')
        (m['set'] || {}).each { |k, v| pl[k] = v }
        (m['unset'] || []).each { |k| pl.delete(k.to_s) }

      else

        h['payload'] = m
      end

      h
    end
So that #reply may be called with
 ```
 reply
 reply(@message)
 reply(payload: {})
 reply(ret: 123)
 reply(ret: 123, set: { a: 1 }, unset: [ :b ])
 ```