{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/czmq/issues/1164","labels_url":"https://api.github.com/repos/zeromq/czmq/issues/1164/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/czmq/issues/1164/comments","events_url":"https://api.github.com/repos/zeromq/czmq/issues/1164/events","html_url":"https://github.com/zeromq/czmq/issues/1164","id":117884499,"number":1164,"title":"zsock_option functions as stand-alone API class or embedded within zsock class?","user":{"login":"paddor","id":8876,"avatar_url":"https://avatars.githubusercontent.com/u/8876?v=3","gravatar_id":"","url":"https://api.github.com/users/paddor","html_url":"https://github.com/paddor","followers_url":"https://api.github.com/users/paddor/followers","following_url":"https://api.github.com/users/paddor/following{/other_user}","gists_url":"https://api.github.com/users/paddor/gists{/gist_id}","starred_url":"https://api.github.com/users/paddor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddor/subscriptions","organizations_url":"https://api.github.com/users/paddor/orgs","repos_url":"https://api.github.com/users/paddor/repos","events_url":"https://api.github.com/users/paddor/events{/privacy}","received_events_url":"https://api.github.com/users/paddor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-19T19:06:15Z","updated_at":"2015-11-20T03:43:57Z","closed_at":null,"body":"I'm improving the generated Ruby bindings of CZMQ. I've noticed that the zsock_option functions ([documentation](http://api.zeromq.org/czmq3-0:zsock-option)) don't have a corresponding XML API file. So I created a GSL file which does that, as the class `zsock_option` (at least for the major ZMQ version 4). See [comparison](https://github.com/zeromq/czmq/compare/master...paddor:better_ruby_bindings?expand=1).\r\n\r\nHowever, I've hit a problem. Those functions aren't prefixed with the expected class name `zsock_option_`, but `zsock_` instead.\r\n\r\nI hesitated adding these functions to the existing `zsock` class XML API, because those functions are documented to\r\n> [...] take a void * \"polymorphic\" reference, which can be either a zsock_t or a zactor_t reference, or a libzmq void *.\r\n\r\nI could just add them to the existing `zsock` class XML API. To set any options on a zactor_t object using a binding later, one would have to create an instance of the Zsock class with a given zactor_t pointer or something.\r\n\r\nI thought it'd nicer to have these functions grouped in a ZsockOption class which can be used for any of the three supported reference types, either by exposing them all as singleton methods. To do this, the `<class>` tag in the XML API files would have to support a new attribute, like `function_prefix = \"zsock_\"`. A nicer approach would be generating a Ruby module which can be mixed into the Zsock and Zactor classes (although this would require additional information from the API file).\r\n\r\nMaybe the Zactor functionality doesn't make a lot of sense in a high-level binding anyway, so one could ignore that requirement, which makes the integration directly into the `zsock` class sound even better.\r\n\r\nWhich approach sounds better to you? Any other ideas?"},"comment":{"url":"https://api.github.com/repos/zeromq/czmq/issues/comments/158270481","html_url":"https://github.com/zeromq/czmq/issues/1164#issuecomment-158270481","issue_url":"https://api.github.com/repos/zeromq/czmq/issues/1164","id":158270481,"user":{"login":"paddor","id":8876,"avatar_url":"https://avatars.githubusercontent.com/u/8876?v=3","gravatar_id":"","url":"https://api.github.com/users/paddor","html_url":"https://github.com/paddor","followers_url":"https://api.github.com/users/paddor/followers","following_url":"https://api.github.com/users/paddor/following{/other_user}","gists_url":"https://api.github.com/users/paddor/gists{/gist_id}","starred_url":"https://api.github.com/users/paddor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddor/subscriptions","organizations_url":"https://api.github.com/users/paddor/orgs","repos_url":"https://api.github.com/users/paddor/repos","events_url":"https://api.github.com/users/paddor/events{/privacy}","received_events_url":"https://api.github.com/users/paddor/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T03:43:57Z","updated_at":"2015-11-20T03:43:57Z","body":"Oh, `project` is an XML item, and the `XML.load_file()` can be called directly on it. Polymorphism all over the place...\r\n\r\nThe rest still doesn't sense."}}