inner_text or self?

0 views
Skip to first unread message

Yurii Rashkovskii

unread,
Jul 7, 2007, 4:48:50 AM7/7/07
to lilu-te...@googlegroups.com
Hello,

another question. I'm thinking to replace self with something like
inner_text. I.e. if you had something like:

update('#blog-entry').with at('a') => { :href => @url, self => @title }

you will need to rewrite it to:

update('#blog-entry').with at('a') => { :href => @url, inner_text =>
@title }

Though in early version both self and inner_text could coexist.

The reason for this change is to provide more meaningful keyword
instead of self.

What do you think about this change?

Thank you,
Yurii.

Lindsay Evans

unread,
Jul 7, 2007, 6:20:46 AM7/7/07
to lilu-te...@googlegroups.com
Hi Yurii,

On 7/7/07, Yurii Rashkovskii <yra...@gmail.com> wrote:
> another question. I'm thinking to replace self with something like
> inner_text.

How about just 'text'?
inner_text seems a bit awkward to me.

Yurii Rashkovskii

unread,
Jul 7, 2007, 6:22:22 AM7/7/07
to lilu-te...@googlegroups.com
>> another question. I'm thinking to replace self with something like
>> inner_text.
>
> How about just 'text'?
> inner_text seems a bit awkward to me.
>

`text' sounds even better for me!

Yurii.

Michael Klishin

unread,
Jul 7, 2007, 7:19:46 AM7/7/07
to lilu-te...@googlegroups.com
What about content? Just a bit more generic meaning.

On 07/07/07, Yurii Rashkovskii <yra...@gmail.com> wrote:

> `text' sounds even better for me!

--
MK

Yurii Rashkovskii

unread,
Jul 7, 2007, 8:24:12 AM7/7/07
to lilu-te...@googlegroups.com
Michael,

Actually `self' logic (which I'm going to rename to `text') is
updating #inner_html and it accepts strings or whatever that will be
#to_s'ed successfully.

And `text' seems to be shorter :)

Thomas Porter

unread,
Jul 7, 2007, 6:13:57 PM7/7/07
to lilu-te...@googlegroups.com
Yurii,

I like the use of the more meaningful name

How would the simple construction when no hash is required work?

For example: right now, I think I can say

update('#blog-entry').with at('p') =>"Stuff to go inside paragraph element"

Would this remain valid syntax, or would I have to use:

update('#blog-entry').with at('p') => { inner_text =>@title }

?

Thanks again for the great plugin.

Tom P.


On 7/7/07, Yurii Rashkovskii <yra...@gmail.com> wrote:
>

Yurii Rashkovskii

unread,
Jul 7, 2007, 6:29:48 PM7/7/07
to lilu-te...@googlegroups.com
Thomas,

> For example: right now, I think I can say
>
> update('#blog-entry').with at('p') =>"Stuff to go inside
> paragraph element"
>
> Would this remain valid syntax, or would I have to use:
>

Yes, it will remain a valid syntax with no doubt, and also you can
make it even simpler:

update('#blog-entry/p').with "Stuff to go inside paragraph element"

in case if you need to update blog-entry's <p> only.

All those kind of constructs work now, the only changed planned is to
rename `self' with `text' (seems to be nicer than `inner_text')

Yurii.

Reply all
Reply to author
Forward
0 new messages