Class: NWRFC::FunctionCall
- Inherits:
-
DataContainer
- Object
- DataContainer
- NWRFC::FunctionCall
- Includes:
- DataContainer
- Defined in:
- lib/nwrfc.old.rb,
lib/nwrfc.rb
Overview
Represents a callable instance of a function module, using a function module description obtained previously. Can be obtained by passing either a function description or calling Function#get_function_call
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#function ⇒ Object
readonly
Returns the value of attribute function.
-
#function_description ⇒ Object
readonly
Returns the value of attribute function_description.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Instance Method Summary collapse
-
#initialize(function_description) ⇒ FunctionCall
constructor
A new instance of FunctionCall.
-
#invoke ⇒ Object
Execute the function call on the SAP server.
- #method_missing(method_sym, *args, &block) ⇒ Object
Constructor Details
#initialize(function_description) ⇒ FunctionCall
Returns a new instance of FunctionCall.
328 329 330 331 332 333 334 335 |
# File 'lib/nwrfc.rb', line 328 def initialize(function) @error = NWRFCLib::RFCError.new @function = function @connection = function.connection @handle = NWRFCLib.create_function(@function.desc, @error.to_ptr) @desc = function.desc NWRFC.check_error(@error) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *args, &block) ⇒ Object
309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/nwrfc.old.rb', line 309 def method_missing(method_sym, *args, &block) param_name = method_sym.to_s.upcase # fpar = NWRFCLib::RFCFuncParam.new # rc = NWRFCLib.get_parameter_desc_by_name(@function_description, param_name.cU, fpar.to_ptr, @error.to_ptr) # NWRFC.check_error(@error) if rc > 0 if param_name[-1..-1] == "=" self[:param_name] = *args[0] else self[:param_name] end end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
326 327 328 |
# File 'lib/nwrfc.rb', line 326 def connection @connection end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
326 327 328 |
# File 'lib/nwrfc.rb', line 326 def desc @desc end |
#function ⇒ Object (readonly)
Returns the value of attribute function.
326 327 328 |
# File 'lib/nwrfc.rb', line 326 def function @function end |
#function_description ⇒ Object (readonly)
Returns the value of attribute function_description.
292 293 294 |
# File 'lib/nwrfc.old.rb', line 292 def function_description @function_description end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
326 327 328 |
# File 'lib/nwrfc.rb', line 326 def handle @handle end |
Instance Method Details
#invoke ⇒ Object
Execute the function call on the SAP server
304 305 306 307 |
# File 'lib/nwrfc.old.rb', line 304 def invoke rc = NWRFCLib.invoke(@connection.handle, @handle, @error.to_ptr) NWRFC.check_error(@error) if rc > 0 end |