dmacvicar / ruby-sfcc

ruby bindings for sblim client
MIT License
6 stars 6 forks source link

Provide a way to pass type information along with value to methods #10

Closed miminar closed 9 years ago

miminar commented 12 years ago

Made CIMCData a ruby object to allow passing values along with types to client methods.

Use case:

Some C sfcb provider is accepting a UInt8 value as method parameter. Originally passing some integer to a method as parameter would turn in into CIMCData d = { .type = CIMC_sint64, .value.sint64 = val }; But providers are often coded in the way, that they check for exact type of input parameter and fail in case they not match. So with this modification one can write:

client.invoke_method(object_path, "some_method_name",
    { "Param1" => Sfcc::Cim::Data.new("UInt8", 10) }, out)

Changes from previous pull request

dmacvicar commented 9 years ago

@kkaempf can you help me reviewing this?

kkaempf commented 9 years ago

Ugh, -EPULLREQUESTTOOLARGE on first sight ;-) But looks OK in general.