Names for these setting helper methods

Can anyone think of better names for these?

class Object

   def instance_from(f, *msgs)
     msgs.each { |m| self.instance_variable_set( "@#{m}", f.send(m) ) }
   end

   def set_from(f, *msgs)
     msgs.each { |m| self.send( "#{m=}", f.send(m) ) }
   end

end

···

--
T.

make that "@{m}="

···

On Thursday 09 September 2004 10:19 pm, T. Onoma wrote:

"#{m=}"

--
T.

In my code I call the first one (or rather, its analog, which takes a
hash) "Object#absorb" and would probably call the second one something
like "Object#soak_in".

class Object
    def exude(*fields=self.instance_variables)
        fields.collect_hash { |m| self.instance_variable_get( m ) }
        end
    def absorb(field_values)
        field_values.each_pair { |k,v|
            self.instance_variable_set( k,v )
            }
        end
    def soak_in(field_values)
        field_values.each.pair { |k,v| self.send( "#@{k}=", v ) }
        end
    end

WARNING: ABOVE CODE TYPED FROM MEMORY WITH A TODDLER'S HELP

-- MarkusQ

···

On Thu, 2004-09-09 at 19:19, T. Onoma wrote:

Can anyone think of better names for these?

class Object

   def instance_from(f, *msgs)
     msgs.each { |m| self.instance_variable_set( "@#{m}", f.send(m) ) }
   end

   def set_from(f, *msgs)
     msgs.each { |m| self.send( "#{m=}", f.send(m) ) }
   end

end

Hmm... you give me idea!

  class Object
    def vulcan_mind_meld(field_values)
      field_values.each_pair { |k,v|
        if k.to_s[0..0] == '@'
          self.instance_variable_set( k,v )
        else
          self.send( "#@{k}=", v ) }
        end
     end
  end

WARNING: ABOVE CODE TYPED FROM MEMORY WITH A TODDLER'S HELP

Thanks MarkusQ!

T.

···

On Friday 10 September 2004 10:15 am, Markus wrote:

In my code I call the first one (or rather, its analog, which takes a
hash) "Object#absorb" and would probably call the second one something
like "Object#soak_in".

--
( o _
// trans.
/ \ transami@runbox.com

I don't give a damn for a man that can only spell a word one way.
-Mark Twain