xrc 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2625430806caeb657924de55a9f55b972f0f9040
4
- data.tar.gz: fb8832570c943cf5d1f145a6918c6e74574f2984
3
+ metadata.gz: fc17ab04c17f6d41c5d1edad4c46e6e6b1d12a80
4
+ data.tar.gz: d0a3195fa27404f84b970e4466c58596f3580163
5
5
  SHA512:
6
- metadata.gz: f8cf72401704a4049fbe31c53d428b2053bfc4f4f49d0e26255496157f91ca00039e2a84bcc43dff96f23512f7029d55c39535b1bf22f231bd86b2ef48dc330d
7
- data.tar.gz: 744130c2d6822f2ccf266c435501229c86d31a9a7687964be82e996ddef0b0c336c625f8f1b92082e5a843115b7d06d58bc5a2008f85e4d63c0d5a109161a252
6
+ metadata.gz: f601f606af18e481a571335a7129a6e6d14d4e7ae2a9e845aa5ee6f0b02270bd5ed8d69552c2fb918749700622ab0b626a9281d1e5941d454648cd89acb932a2
7
+ data.tar.gz: 74eb1936d5da2720c12c48412fe73d214ae553bdb8989fcaa41301cc049b55aa4184152630d58dcfcccc6d3d650623cce6c41931f67709db1a76f850ac68cd8e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.3
2
+ * Make Xrc::Client#say public
3
+
1
4
  ## 0.0.2
2
5
  * Fix authentication timing
3
6
 
data/lib/xrc/client.rb CHANGED
@@ -92,6 +92,23 @@ module Xrc
92
92
  )
93
93
  end
94
94
 
95
+ # Send a message
96
+ # @option options [String] :body Message body
97
+ # @option options [String] :from Sender's JID
98
+ # @option options [String] :to Address JID
99
+ # @option options [String] :type Message type (e.g. chat, groupchat)
100
+ # @return [REXML::Element] Returns an element sent to server
101
+ # @example
102
+ # client.say(body: "Thanks", from: "alice@example.com", to: "bob@example.com", type: "chat")
103
+ def say(options)
104
+ post Elements::Message.new(
105
+ body: options[:body],
106
+ from: options[:from],
107
+ to: options[:to],
108
+ type: options[:type],
109
+ )
110
+ end
111
+
95
112
  # @return [String] Mention name of this account
96
113
  # @example
97
114
  # client.mention_name #=> "alice"
@@ -298,15 +315,6 @@ module Xrc
298
315
  post(Elements::Auth.new(jid: jid, password: password))
299
316
  end
300
317
 
301
- def say(options)
302
- post Elements::Message.new(
303
- body: options[:body],
304
- from: options[:from],
305
- to: options[:to],
306
- type: options[:type],
307
- )
308
- end
309
-
310
318
  def start_ping_thread
311
319
  Thread.new do
312
320
  loop do
data/lib/xrc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xrc
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura