messenger_client 0.1.4 → 0.1.5

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: 524b8fdd5ffac1533800a6a5737614955ee99cbb
4
- data.tar.gz: 3422f84c7585c921c58bc876e8acfc038477b0f4
3
+ metadata.gz: 581159816dea2145b543e61c4faf8134da6a7752
4
+ data.tar.gz: 667bce930cb55d9b0b8ef99493ab78e17c9d94ea
5
5
  SHA512:
6
- metadata.gz: 48caaea31af3ef54007c7a5aa561b79c3bf44aadd7d8866cfb73cdded4e0fd8ca6449f3ad4a2ddb3f16cee391fc4318343d51a5c298c94ffd4f7ffaff9932ad1
7
- data.tar.gz: fe6fde59c460a050bc1f214958c6cc8f8ae5cec4f8baa8d3c3f4accf2e9c74f2259c3a3560aaa0660c4b52d39b881b17e6b7825028039da90f79420fc74b52d9
6
+ metadata.gz: 38166248244119fd50dc5835fb3b3f32da97889c82f97cfbcc945808fc737c462af9c894f9179734cc3f16133d96d3e5cfbc3a50ac3b2230810fe84f2a5556eb
7
+ data.tar.gz: 100108c26449f1b67f712fe443b0e2a19a4625fe67bd169545759b3c43b8090d96bc8ef8bfac26afcd963d0e807f1b4efece043154f92b62408180bbad521097
@@ -0,0 +1,6 @@
1
+ module MessengerClient
2
+ module Message
3
+ Optin = Base.new(:timestamp, :sender, :ref)
4
+ end
5
+ end
6
+
@@ -19,7 +19,7 @@ module MessengerClient
19
19
  timestamp = message["timestamp"]
20
20
  m = message["message"]
21
21
  if m.nil?
22
- return parse_postback(message, timestamp, sender)
22
+ return parse_non_message(message, timestamp, sender)
23
23
  end
24
24
  if attchs = m["attachments"]
25
25
  attch = attchs.first
@@ -60,11 +60,15 @@ module MessengerClient
60
60
  return nil
61
61
  end
62
62
 
63
- def parse_postback(message, timestamp, sender)
63
+ def parse_non_message(message, timestamp, sender)
64
64
  if pb = message["postback"]
65
65
  payload = pb["payload"].to_sym
66
66
  return MessengerClient::Message::Postback.new(timestamp, sender, payload)
67
67
  end
68
+ if optin = message["optin"]
69
+ ref = optin["ref"]
70
+ return MessengerClient::Message::Optin.new(timestamp, sender, ref)
71
+ end
68
72
  return nil
69
73
  end
70
74
  end
@@ -1,3 +1,3 @@
1
1
  module MessengerClient
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messenger_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Cruz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-07 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,6 +102,7 @@ files:
102
102
  - lib/messenger_client/message/file.rb
103
103
  - lib/messenger_client/message/image.rb
104
104
  - lib/messenger_client/message/location.rb
105
+ - lib/messenger_client/message/optin.rb
105
106
  - lib/messenger_client/message/postback.rb
106
107
  - lib/messenger_client/message/quick_reply.rb
107
108
  - lib/messenger_client/message/sender.rb