Giter VIP home page Giter VIP logo

tocaro_webhook's Introduction

TocaroWebhook

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/tocaro_webhook. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

gem 'tocaro_webhook'

And then execute:

$ bundle install

install palne ruby

$ gem install tocaro_webhook

Usage

Call TocaroWebhook::Sender class.

require 'tocaro_webhook'

webhook_sender = TocaroWebhook::Sender.new('your api key')

exec send message

webhook_sender.payload.add_attachment(title: "title", value: "value", image_url: "htttp://image_url.com")
# or some attribute
# webhook_sender.payload.add_attachment(title: "title")
# webhook_sender.payload.add_attachment(value: "value")
# webhook_sender.payload.add_attachment(value: "value", image_url: "htttp://image_url.com")
webhook_sender.exec

some attachments

webhook_sender.payload.add_attachment(title: "title", value: "value", image_url: "http://image_url.com")
webhook_sender.payload.add_attachment(image_url: "http://image_url.com")
webhook_sender.payload.add_attachment(title: "title", value: "value")

webhook_sender.exec

return HTTP response class.

res = webhook_sender.exec
res.code # => "200"

test

Send test exec when .env file write your webhook key. Env file use dotenv gem. (https://github.com/bkeepers/dotenv)

TEST_TOCARO_WEB_HOOK_KEY="your web hook key"

tocaro_webhook's People

Contributors

megaya avatar

Watchers

たびと avatar James Cloos avatar tshinden avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.