RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Bauser, Joseph (Joe)
Of Sam Sent: Monday, July 10, 2006 10:51 AM To: rails-spinoffs@lists.rubyonrails.org Subject: RE: [Rails-spinoffs] prototype hash method Sam wrote: > Is it easy to explain the difference between a hash > > var myHash = {a: 'value for a'} > > and an object > >

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Brandon Aaron
Here it is as a one-liner that I use often to merge a set of options with a default:options = Object.extend(Object.extend({}, _defaultOptions), options);_defaultOptions =  your defaultsoptions = passed in options and then the merged options BrandonOn 7/10/06, Sam <[EMAIL PROTECTED]> wrote: Sam wrot

RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Sam
Sam wrote: > Is it easy to explain the difference between a hash > > var myHash = {a: 'value for a'} > > and an object > > var myObject = {a: 'value for a'} There is no difference between those. They are both associative arrays (hashes). --- S

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Tobie Langel
;[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] prototype hash method To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" try it this way: var v1 = { a: 'value for a', b:'value for

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Fernando
auer" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] prototype hash method To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" try it this way: var v1 = { a: 'value for a', b:'valu

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Tobie Langel
}; var v3 = Object.extend(v1, v2); This will preserve your function. regards, Tobie On 10 juil. 2006, at 16:03, [EMAIL PROTECTED] wrote: From: "Siegfried Puchbauer" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] prototype hash method To: rails-spinoffs@lists.ru

RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Bauser, Joseph (Joe)
D] [mailto:[EMAIL PROTECTED] Behalf Of Fernando Sent: Monday, July 10, 2006 10:03 AM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] prototype hash method "but v2.d will be ignored (type of the value is function)" ok, but so how to do this : I have Default Options for

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Fernando
"but v2.d will be ignored (type of the value is function)" ok, but so how to do this : I have Default Options for all my Ajax.Updater() DefaultOptions = { asynchronous:true, evalScripts:true, onLoaded:function(request){Element.hide('spinner')}, onLoading:function(request){

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Michael Peters
Sam wrote: > Is it easy to explain the difference between a hash > > var myHash = {a: 'value for a'} > > and an object > > var myObject = {a: 'value for a'} There is no difference between those. They are both associative arrays (hashes). -- Michael Peters Developer Plus Three, LP __

RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Sam
Title: Message Is it easy to explain the difference between a hash   var myHash = {a: 'value for a'}   and an object   var myObject = {a: 'value for a'}   Sam ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonr

Re: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Siegfried Puchbauer
try it this way:var v1 = { a: 'value for a', b:'value for b' }; var v2 = { c: 'value for c', d: function(){} }; var v3 = $H(v2).merge($H(v1)); v3.inspect();// # but v2.d will be ignored (type of th

[Rails-spinoffs] prototype hash method

2006-07-10 Thread Fernando
var v1 = { a: 'value for a', b:'value for b' } var v2 = { c: 'value for c', d: function(){some code...} }; var v3 = v2.merge(v1); I'm getting an error doing this... what is wrong? ___