idobata 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cdb8ee942283022d9865dc466d39a888f9f1421
4
- data.tar.gz: 7ce2d8da8a382488db7cc35ae54324066bed6f8f
3
+ metadata.gz: 7d3aac7cf1635d8bad8a519b03cef797b0b20c0a
4
+ data.tar.gz: 16af1aa976282a3aeee5893a326137ff7e7df769
5
5
  SHA512:
6
- metadata.gz: 776e0a900ae5873ac6ceac474e68599983f50a26b408b2a03f3503af8439639114335cf964eb041796fdbc1ef70717988fcbf230ed8c711ad1533acfc7f59f55
7
- data.tar.gz: 3635ce8757fb7faebc0d264ce17d2653fbff1f6ecedcaf0ad1b214c84e9fc1f274621eb620a85f51f0e3ec73864ee20a723eebdb6cddfee9a4d910976d59d3b2
6
+ metadata.gz: 5d32ef09a1ef2c58fda5e7c659c9fa54c8e33183320e02cabf685bf6598bc1a7982ac1d300f19fd016fd3a74748ea9842976b04df46e23ba73fb049a8962542a
7
+ data.tar.gz: 9806ea8e11c74ba0a1148b2442c16ae393978936c706df8a28cfb9de8a1fe3193da7589283ab026bdf4d020cf09bce7c58b92635c4935a0143d3bd193be96bea
data/README.md CHANGED
@@ -18,7 +18,18 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ```
22
+ require 'idobata'
23
+
24
+ # set hook url
25
+ Idobata.hooK_url = "https://idobata.io/hook/XXXXX"
26
+
27
+ # plain text
28
+ Idobata::Message.create(source: "Hello, Idobata!")
29
+
30
+ # html format
31
+ Idobata::Message.create(source: "<marquee>Hello, Idobata!</marquee>", format: :html)
32
+ ```
22
33
 
23
34
  ## Contributing
24
35
 
data/lib/idobata.rb CHANGED
@@ -4,20 +4,20 @@ module Idobata
4
4
  autoload(:Client, 'idobata/client')
5
5
  autoload(:Message, 'idobata/message')
6
6
 
7
- @api_base = nil
7
+ @hook_url = nil
8
8
 
9
9
  class << self
10
10
  def client
11
- @client ||= Client.new(@api_base)
11
+ @client ||= Client.new(@hook_url)
12
12
  end
13
13
 
14
- def api_base=(new_value)
15
- @api_base = new_value
14
+ def hook_url=(new_value)
15
+ @hook_url = new_value
16
16
  @client = nil
17
17
  end
18
18
 
19
- def api_base
20
- @api_base
19
+ def hook_url
20
+ @hook_url
21
21
  end
22
22
  end
23
23
  end
@@ -2,11 +2,11 @@ require 'faraday'
2
2
 
3
3
  module Idobata
4
4
  class Client
5
- def initialize(api_base)
5
+ def initialize(hook_url)
6
6
  default_header = {
7
7
  'User-Agent' => "Idobata / RubyBinding/#{Idobata::VERSION}"
8
8
  }
9
- @conn = Faraday.new(api_base, headers: default_header) do |builder|
9
+ @conn = Faraday.new(hook_url, headers: default_header) do |builder|
10
10
  builder.request :url_encoded
11
11
  builder.adapter Faraday.default_adapter
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Idobata
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idobata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - asonas