Class: SAPNW::RFC::Table
- Inherits:
-
Parameter
- Object
- Parameters::Base
- Parameter
- SAPNW::RFC::Table
- Defined in:
- lib/sapnwrfc/parameters.rb
Overview
RFC Table type Parameters
Instance Attribute Summary
Attributes inherited from Parameter
#decimals, #direction, #len, #name, #typdef, #type, #ulen, #value
Instance Method Summary collapse
-
#each ⇒ Object
Yields each row of the table to passed Proc.
-
#initialize(*args) ⇒ Table
constructor
A new instance of Table.
-
#length ⇒ Object
returns the no.
-
#value=(val = []) ⇒ Object
assign an Array, of rows represented by Hashes to the value of the Table parameter.
Methods inherited from Parameter
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SAPNW::RFC::Parameter
Instance Method Details
#each ⇒ Object
Yields each row of the table to passed Proc
260 261 262 263 264 265 |
# File 'lib/sapnwrfc/parameters.rb', line 260 def each return nil unless @value @value.each do |row| yield row end end |
#length ⇒ Object
returns the no. of rows currently in the table
239 240 241 |
# File 'lib/sapnwrfc/parameters.rb', line 239 def length return @value.length end |
#value=(val = []) ⇒ Object
assign an Array, of rows represented by Hashes to the value of the Table parameter.
245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/sapnwrfc/parameters.rb', line 245 def value=(val=[]) unless val.is_a?(Array) raise TypeError, "Must be Array for table value (#{@name}/#{val.class})\n" end cnt = 0 val.each do |row| cnt += 1 unless row.is_a?(Hash) raise TypeError, "Must be Hash for table row value (#{@name}/#{cnt}/#{row.class})\n" end end @value = val end |