This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The integration developer needs to create the method processData | |
* This method takes Message object of package com.sap.gateway.ip.core.customdev.util | |
* which includes helper methods useful for the content developer: | |
* | |
* The methods available are: | |
public java.lang.Object getBody() | |
//This method helps User to retrieve message body as specific type ( InputStream , String , byte[] ) - e.g. message.getBody(java.io.InputStream) | |
public java.lang.Object getBody(java.lang.String fullyQualifiedClassName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stockprice(prices) | |
puts "From the stocks:\n" | |
prices.each { |x| puts x} | |
to_buy = prices.min | |
prices.delete(to_buy) | |
to_sell = prices.max | |
puts "Buy for : #{to_buy}$\n" | |
puts "Sell for: #{to_sell}$\n" | |
puts "For a profit of #{to_sell - to_buy}$" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def firstTwoLetters(str) | |
return str[0,2] | |
end |