# Methods for things that can be accessed through properties

**URL:** <https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907>\
**Category:** Ruby-Gnome 2\
**Created:** [November 10, 2010, 1:45pm UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907 "2010-11-10T13:45:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 10, 2010, 1:45pm UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907/1 "2010-11-10T13:45:45Z")

</div>

Hi!

What do we do with methods for things that can be accessed through  
properties?

As an example, GMountOperation has g\_mount\_operation\_get\_anonymous.  
Should this be implemented as GLib::MountOperation#anonymous?, or is  
it enough that introspection adds anonymous? for the specified  
property?

I see no real reason for implementing these property-getting/-setting  
methods manually, but I might be missing something.

> **[Gio-2.0](https://docs.gtk.org/gio/)**
>
> Reference for Gio-2.0

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [November 10, 2010, 2:46pm UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907/2 "2010-11-10T14:46:45Z")

</div>

Hi,

In [AANLkTinBMdzX5fFE=removed\_email\_address@domain.invalid](mailto:AANLkTinBMdzX5fFE=removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Methods for things that can be accessed  
through properties” on Wed, 10 Nov 2010 13:45:06 +0100,  
Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What do we do with methods for things that can be accessed through properties?

I think that accessors for properties are generated  
automatically. And boolean properties will also get XXX?  
accessors.

P.S. Nikolai, did you see the bug?

> **[Ruby-GNOME 2 / Bugs / #155 gio2 0.90.5 fails to compile with glib 2.27.2](https://sourceforge.net/p/ruby-gnome2/bugs/155/)**

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [November 10, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907/3 "2010-11-10T15:23:51Z")

</div>

On Wed, Nov 10, 2010 at 14:45, Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In [AANLkTinBMdzX5fFE=removed\_email\_address@domain.invalid](mailto:AANLkTinBMdzX5fFE=removed_email_address@domain.invalid)  
> “[ruby-gnome2-devel-en] Methods for things that can be accessed through  
> properties” on Wed, 10 Nov 2010 13:45:06 +0100,  
> Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > What do we do with methods for things that can be accessed through properties?
> 
> I think that accessors for properties are generated  
> automatically. And boolean properties will also get XXX?  
> accessors.

Yes, that seems to be the case. I will remove all duplicated functions.

> P.S. Nikolai, did you see the bug?

> **[Ruby-GNOME 2 / Bugs / #155 gio2 0.90.5 fails to compile with glib 2.27.2](https://sourceforge.net/p/ruby-gnome2/bugs/155/)**

No. As stated, 2.27 is a development series and there has not been a  
deprecation of that constant, so I find it a bit odd. I’ll look into  
it. I’ve noticed quite a few other small bugs while creating the  
documentation, which is about halfway done.

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [November 11, 2010, 10:47am UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907/4 "2010-11-11T10:47:19Z")

</div>

On Wed, Nov 10, 2010 at 14:45, Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I think that accessors for properties are generated  
> automatically. And boolean properties will also get XXX?  
> accessors.

Actually, it seems that a bit too many properties are generated. It  
would be better if properties weren’t generated if a method of the  
same name already exists. This is, for example, important for the  
data property of GLib::MemoryOutputStream. The property is of type  
gpointer, but to be usable you want to return a Ruby String. Also,  
the destroy-function and realloc-function are completely useless on  
the same class, and it would be nice if there was a way to tell GLib  
to ignore these properties as well.

Any input on how we solve this?

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [November 11, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/methods-for-things-that-can-be-accessed-through-properties/198907/5 "2010-11-11T14:19:10Z")

</div>

Hi,

In [AANLkTi=removed\_email\_address@domain.invalid](mailto:AANLkTi=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Methods for things that can be accessed  
through properties” on Thu, 11 Nov 2010 10:46:21 +0100,  
Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> gpointer, but to be usable you want to return a Ruby String. Also,  
> the destroy-function and realloc-function are completely useless on  
> the same class, and it would be nice if there was a way to tell GLib  
> to ignore these properties as well.
> 
> Any input on how we solve this?

Sorry. There is no way for this.  
You can undef generated methods or improve Ruby/GLib2.

## Thanks,

kou
