lib/wei-backend/base.rb in wei-backend-0.0.5 vs lib/wei-backend/base.rb in wei-backend-0.0.6
- old
+ new
@@ -11,10 +11,15 @@
def handle_event_message
send(:"handle_#{params[:Event].downcase}_message")
end
def create_model data
- data.is_a?(Hash) || data.is_a?(Array) ? image_text_message(data) : text_message(data)
+ case data
+ when Hash, Array
+ image_text_message(data)
+ else
+ text_message(data)
+ end
end
def text_message(data)
{
:format => 'text',