Class: NWRFC::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/nwrfc.rb

Overview

Represents a function parameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Parameter

Create a parameter by setting parameter attributes



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/nwrfc.rb', line 111

def initialize(*args)
  attr = args[0]
  @handle                 = NWRFCLib::RFCFuncParam.new
  @handle[:name]          = attr[:name].cU if attr[:name]
  @handle[:direction]     = NWRFCLib::RFC_DIRECTION[attr[:direction]] if attr[:direction]
  @handle[:type]          = NWRFCLib::RFC_TYPE[attr[:type]] if attr[:type]
  @handle[:ucLength]      = attr[:length] * 2 if attr[:length]
  @handle[:nucLength]     = attr[:length] if attr[:length]
  @handle[:decimals]      = attr[:decimals] if attr[:decimals]
  # TODO: Add support for type description
  #@handle[:typeDescHandle]
  @handle[:defaultValue]  = attr[:defaultValue].cU if attr[:defaultValue]
  @handle[:parameterText] = attr[:parameterText].cU if attr[:parameterText]
  @handle[:optional]      = abap_bool(attr[:optional]) if attr[:optional]
end

Instance Attribute Details

#handleObject

Returns the value of attribute handle.



108
109
110
# File 'lib/nwrfc.rb', line 108

def handle
  @handle
end