Method: GoodData::Subscription#initialize
- Defined in:
- lib/gooddata/models/subscription.rb
#initialize(json) ⇒ Subscription
Initializes object instance from raw wire JSON
115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/gooddata/models/subscription.rb', line 115 def initialize(json) super @json = json @title = data['meta']['title'] @message = data['message']['template']['expression'] @subject = data['subject']['template']['expression'] @process = data['condition']['condition']['expression'][/'(.*)'/, 1] @channels = data['channels'] @project_events = data['triggers'].find { |h| h.keys.first == 'projectEventTrigger' }['projectEventTrigger']['types'] timer_events = data['triggers'].select { |h| h.keys.first == 'timerEvent' } timer_events && @timer_events = timer_events.map { |_, v| v } end |