mitake 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: f243f92bac9f2f716c696e47841e65b41833c66f6c79c6811dff250c7ad32405
4
- data.tar.gz: e5ff6e87671fe045676a71069a661b39884a44790370136ddba13a3951ab0fac
3
+ metadata.gz: 0bc77dea3bd7f54bf6d2caa74e29b07e6ec41f638e6ff690a1ec192926d68f3b
4
+ data.tar.gz: 927a1db28c4873a67cd9bada409668566cb5f6538fc809a63e9a84d5120af3cf
5
5
  SHA512:
6
- metadata.gz: 844dfdc83c9010bcf1d8b02eb5859fcbd6b1afdce324a34f2f8211058b8c022a4aa3bb9984cad43ee9d2774eb661913a28a75f4ca12d82076718b2ca5e9ef0a0
7
- data.tar.gz: f016c37ce3909bc05af6a08385d88a300402d42f172c187c6c92ebb3f87daed076b1591f77a6ef5c9bf7282ff438ac44df084332e93aee1c82a96c76a842f803
6
+ metadata.gz: '03486c3db05629c230e9cbd2512cd7542afa21bfa5f6bef4f5581187b1ad92f84186834b69ffe102de3d5ab474c89d75814c40424f4c458f58f154f943b45209'
7
+ data.tar.gz: 321ce56965a7760cce6634d1c774f519181bbe39d85b346d81ad372e9817b041b1a97e40105d274e82a802edd91d5a73a51c899e40602019bedb318769553495
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mitake (0.1.0)
4
+ mitake (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Zheng Xian Qiu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Mitake (三竹簡訊)
2
+ [![Build Status](https://travis-ci.com/elct9620/mitake.svg?branch=master)](https://travis-ci.com/elct9620/mitake) [![Gem Version](https://badge.fury.io/rb/mitake.svg)](https://badge.fury.io/rb/mitake) [![Maintainability](https://api.codeclimate.com/v1/badges/2da932d77d1a2d37a18a/maintainability)](https://codeclimate.com/github/elct9620/mitake/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/2da932d77d1a2d37a18a/test_coverage)](https://codeclimate.com/github/elct9620/mitake/test_coverage)
2
3
 
3
4
  This is a Ruby implement to help user send SMS via 三竹簡訊 easier.
4
5
 
@@ -31,6 +32,9 @@ If you prefer to config it by the environment variable, please setup `MITAKE_USE
31
32
  > The default server is `https://smsapi.mitake.com.tw` if you use a different server, please specify it manual.
32
33
 
33
34
  ```ruby
35
+ # Get the balance in the account
36
+ puts "Point: #{Mitake::Balance.amount}"
37
+
34
38
  # Create recipient and give phone number
35
39
  recipient = Mitake::Recipient.new(phone_number: '09xxxxxxxx', name: 'John')
36
40
 
@@ -68,7 +72,8 @@ end
68
72
  |body|String| The message body
69
73
  |schedule_at|Time| The schedule time to send message
70
74
  |expired_at|Time| The message expire time, max value is `+ 24h`
71
- |duplicate|TrueClass|FalseClass| `Readonly` The message is duplicate (already sent)
75
+ |webhook_url|String| The Callback URL for Mitake response status
76
+ |duplicate|TrueClass/FalseClass| `Readonly` The message is duplicate (already sent)
72
77
  |status_code|Integer| `Readonly` The message status
73
78
 
74
79
  ## Roadmap
@@ -44,6 +44,10 @@ module Mitake
44
44
  # @return [Time|NilClass] the valid time for this message
45
45
  attribute :expired_at, Time
46
46
 
47
+ # @!attribute webhook_url
48
+ # @return [String|NilClass] the response callback url
49
+ attribute :webhook_url, String
50
+
47
51
  # @!attribute [r] duplicate
48
52
  # @return [TrueClass|FalseClass] is the message duplicate
49
53
  attribute :duplicate, Boolean, readonly: true
@@ -107,7 +111,8 @@ module Mitake
107
111
  dlvtime: @schedule_at&.strftime('%Y%m%d%H%M%S'),
108
112
  vldtime: @expired_at&.strftime('%Y%m%d%H%M%S'),
109
113
  dstaddr: @recipient.phone_number,
110
- destname: @recipient.name
114
+ destname: @recipient.name,
115
+ response: @webhook_url
111
116
  }.reject { |_, v| v.nil? }.to_h
112
117
  end
113
118
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mitake
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-24 00:00:00.000000000 Z
11
+ date: 2019-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,7 @@ files:
108
108
  - CODE_OF_CONDUCT.md
109
109
  - Gemfile
110
110
  - Gemfile.lock
111
+ - LICENSE
111
112
  - README.md
112
113
  - Rakefile
113
114
  - bin/console