Class: CrystalApi::ReceivedWebhookParser

Inherits:
Object
  • Object
show all
Defined in:
lib/crystal_api/received_webhook_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_postObject (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

#jsonObject



13
14
15
# File 'lib/crystal_api/received_webhook_parser.rb', line 13

def json
  @json ||= MultiJson.load(raw_post)
end

#webhookObject



9
10
11
# File 'lib/crystal_api/received_webhook_parser.rb', line 9

def webhook
  WebhookEnvelope.from_json(json)
end