Class: CrystalApi::ReceivedWebhookParser
- Inherits:
-
Object
- Object
- CrystalApi::ReceivedWebhookParser
- Defined in:
- lib/crystal_api/received_webhook_parser.rb
Instance Attribute Summary collapse
-
#raw_post ⇒ Object
readonly
Returns the value of attribute raw_post.
Instance Method Summary collapse
-
#initialize(raw_post) ⇒ ReceivedWebhookParser
constructor
A new instance of ReceivedWebhookParser.
- #json ⇒ Object
- #webhook ⇒ Object
Constructor Details
#initialize(raw_post) ⇒ ReceivedWebhookParser
Returns a new instance of ReceivedWebhookParser.
5 6 7 |
# File 'lib/crystal_api/received_webhook_parser.rb', line 5 def initialize(raw_post) @raw_post = raw_post end |
Instance Attribute Details
#raw_post ⇒ Object (readonly)
Returns the value of attribute raw_post.
3 4 5 |
# File 'lib/crystal_api/received_webhook_parser.rb', line 3 def raw_post @raw_post end |
Instance Method Details
#json ⇒ Object
13 14 15 |
# File 'lib/crystal_api/received_webhook_parser.rb', line 13 def json @json ||= MultiJson.load(raw_post) end |
#webhook ⇒ Object
9 10 11 |
# File 'lib/crystal_api/received_webhook_parser.rb', line 9 def webhook WebhookEnvelope.from_json(json) end |