Class: Oksky::Chat::WhClient
- Inherits:
-
Object
- Object
- Oksky::Chat::WhClient
- Defined in:
- lib/oksky/chat/whclient.rb
Instance Method Summary collapse
-
#parse_events_from(request_body) ⇒ Array<Oksky::Chat::Event::Class>
Parse events from request.body.
Instance Method Details
#parse_events_from(request_body) ⇒ Array<Oksky::Chat::Event::Class>
Parse events from request.body
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/oksky/chat/whclient.rb', line 10 def parse_events_from(request_body) json = JSON.parse(request_body) begin klass = Oksky::Chat::Object.const_get("#{object_type(json['object_name']).capitalize}Resource") klass.new(json['object']) rescue NameError => e Oksky::Chat::Object::UnsupportResource.new(json['object']) end end |