* Josef Reidinger <[email protected]> [Jun 25. 2013 11:35]:
> Hi,
> I would like to discuss one think that is related to creating UI in
> YaST in ruby. In YCP it uses terms. In ruby generic terms looks like:
> 
> term(:VBox,...)
> 
> but it is not much nice for me, so I create few shortcuts for known UI
> elements and it looks like this:
> 
> VBox(...)

Agreed, the latter one looks so much nicer.

> 
> There is a problem. In UI is often used terms `id and `opts, but it
> doesn't start with uppercase and there is high chance to collide with
> existing methods ( beside id collide with ruby id method ).

Usage of object#id is not a problem if 'id' is defined in object's
class.

> So I
> propose to translate it to
> ID(:id) and OPTS(:strechable,:notify)

Ugh, all caps is reserved for constants in Ruby.

> 
> alternative can be Opts and Id.
> what is your opinion?

libyui-bindings has more complete examples
(https://github.com/kkaempf/libyui-bindings/tree/master/swig/ruby/examples)
which could help guiding a decision.


Klaus
-- 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 
16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to