lib/intellimesh/messages/message.rb
def update_message_header(**new_properties)
          reset_message! unless @message.present?

          new_properties.each_pair do |key, value|
            case key
            when :id then raise ArgumentError, "id attribute is readonly"
            when :body then next
            when :context, :meta
            	value.each_pair { |k,v| update_message_header({k => v}) }
            else
              if HEADER_KEYS.include?(key)
                @message_header.update({key => value})
              elsif HEADER_CONTEXT_KEYS.include?(key)
                self.send(:update_message_context, {key => value})
              else
                self.send(:update_message_meta, {key => value})
              end
            end

            @message_header
          end
        end
# Set or update message header properties.   If the property isn't one of
# the recognized keys, it goes into the meta section
Set or update message header properties.   If the property isn't one of
the recognized keys, it goes into the meta section
Set or update message header properties . If the property isn ' t one of the recognized keys it goes into the meta section
def update_message_header(**new_properties)
          reset_message! unless @message.present?
          new_properties.each_pair do |key, value|
            case key
            when :id then raise ArgumentError, "id attribute is readonly"
            when :body then next
            when :context, :meta
            	value.each_pair { |k,v| update_message_header({k => v}) }
            else
              if HEADER_KEYS.include?(key)
                @message_header.update({key => value})
              elsif HEADER_CONTEXT_KEYS.include?(key)
                self.send(:update_message_context, {key => value})
              else
                self.send(:update_message_meta, {key => value})
              end
            end
            @message_header
          end
        end
def update_message_header ( ** new_properties ) reset_message! unless @message . present? new_properties . each_pair do | key , value | case key when :id then raise ArgumentError , "id attribute is readonly" when :body then next when :context , :meta value . each_pair { | k , v | update_message_header ( { k => v } ) } else if HEADER_KEYS . include? ( key ) @message_header . update ( { key => value } ) elsif HEADER_CONTEXT_KEYS . include? ( key ) self . send ( :update_message_context , { key => value } ) else self . send ( :update_message_meta , { key => value } ) end end @message_header end end
Set or update message header properties.
Set or update message header properties .
new_properties