Skip to content

Commit

Permalink
Add recipient method to incoming message
Browse files Browse the repository at this point in the history
  • Loading branch information
sorich87 committed Jun 27, 2016
1 parent 4a8408e commit 1aa949a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/facebook/messenger/incoming/message.rb
Expand Up @@ -17,6 +17,10 @@ def sender
@messaging['sender']
end

def recipient
@messaging['recipient']
end

def seq
@messaging['message']['seq']
end
Expand Down
6 changes: 6 additions & 0 deletions spec/facebook/messenger/incoming/message_spec.rb
Expand Up @@ -44,6 +44,12 @@
end
end

describe '.recipient' do
it 'returns the recipient' do
expect(subject.recipient).to eq(payload['recipient'])
end
end

describe '.seq' do
it 'returns the message sequence number' do
expect(subject.seq).to eq(payload['message']['seq'])
Expand Down

0 comments on commit 1aa949a

Please sign in to comment.