Sha256: a074f05f1db3b017b4a6a0f3f98cafee92d2529f975f31c2c58b1b73e94083e7

Contents?: true

Size: 500 Bytes

Versions: 7

Compression:

Stored size: 500 Bytes

Contents

require 'json'
module DingBot
  module Message

    module TYPE
      TEXT = 'text'
      LINK = 'link'
      MARKDOWN = 'markdown'
      ACTION_CARD = 'actionCard'
      FEED_CARD = 'feedCard'
    end

    # Base Message
    class Base

      def msg_type
        # implement inside child
      end

      def body_params
        {
            msgtype: msg_type
        }
      end

      # Set http post body as json string
      def to_json
        body_params.to_json
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dingbot-0.2.5 lib/dingbot/message/base.rb
dingbot-0.2.3 lib/dingbot/message/base.rb
dingbot-0.2.2 lib/dingbot/message/base.rb
dingbot-0.2.1 lib/dingbot/message/base.rb
dingbot-0.2.0 lib/dingbot/message/base.rb
dingbot-0.1.1 lib/dingbot/message/base.rb
dingbot-0.1.0 lib/dingbot/message/base.rb