Class: Wukong::Processor::Topic

Inherits:
Wukong::Processor show all
Defined in:
lib/wukong/widget/processors.rb

Constant Summary

Constants inherited from Wukong::Processor

SerializerError

Instance Method Summary collapse

Methods inherited from Wukong::Processor

configure, consumes, description, #expected_record_type, #expected_serialization, #finalize, produces, #receive_action, #setup, #stop, valid_serializer?, validate_and_set_serialization

Methods included from Logging

included

Methods included from Hanuman::StageClassMethods

#builder, #label, #register, #set_builder

Instance Method Details

#assign_topic(record, topic_name) ⇒ Object



186
187
188
189
# File 'lib/wukong/widget/processors.rb', line 186

def assign_topic(record, topic_name)
  record.define_singleton_method(:topic){ topic_name }
  record
end

#perform_action(record) ⇒ Object



182
183
184
# File 'lib/wukong/widget/processors.rb', line 182

def perform_action(record)
  assign_topic(record, topic)
end

#process(record) {|perform_action(record)| ... } ⇒ Object

Yields:



178
179
180
# File 'lib/wukong/widget/processors.rb', line 178

def process(record)
  yield perform_action(record)
end